[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] AMF::encodeElement

From: strk
Subject: [Gnash-dev] AMF::encodeElement
Date: Tue, 9 Dec 2008 12:40:35 +0100

I'm comparing tcp dumps of gnash and pp while trying to
encode NetConnection encoding for rtmpget.

The bug I'm up to is on encoding a string element
being the string 'connect', which with libamf results
in 2 bytes more then required.

The AMF type is 1 byte, for a string we have 2 bytes of 
length and then the string (not null-terminated):

 02       00 07    63 6f 6e 6e 65 63 74
 <type>   <len>    c  o  n  n  e  c  t

This gives a total buffer length of 10 (7+3)
but Element::encode() returns a buffer of 12 bytes.

This in turn results in a problem when concatenating buffers
as there'll always be 2 bytes of padding between the
resulting encoded string and the next appended buffer.

While looking for existing testcase to add tests to
I found there *are* tests for encoding string elements,
but are not enabled in both trunk and the rtmp branch.
testsuite/libamf.all/test_string.cpp would be it, but
the in there doesn't enable it.

Whats the reason to skip those tests ?


 ()   ASCII Ribbon Campaign
 /\   Keep it simple! 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]