[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10043: Commit Andreas Schwab's bug
From: |
Russell Nelson |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10043: Commit Andreas Schwab's bug fixes |
Date: |
Tue, 21 Oct 2008 17:34:45 -0400 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10043
committer: Russell Nelson <address@hidden>
branch nick: trunk
timestamp: Tue 2008-10-21 17:34:45 -0400
message:
Commit Andreas Schwab's bug fixes
modified:
libamf/buffer.cpp
libnet/rtmp.cpp
libnet/rtmp_server.cpp
=== modified file 'libamf/buffer.cpp'
--- a/libamf/buffer.cpp 2008-08-02 22:55:21 +0000
+++ b/libamf/buffer.cpp 2008-10-21 21:34:45 +0000
@@ -169,7 +169,7 @@
{
GNASH_REPORT_FUNCTION;
*_ptr = val;
- _seekptr = _ptr + sizeof(bool);
+ _seekptr = _ptr + sizeof(Network::byte_t);
}
#if 0
=== modified file 'libnet/rtmp.cpp'
--- a/libnet/rtmp.cpp 2008-09-04 15:17:06 +0000
+++ b/libnet/rtmp.cpp 2008-10-21 21:34:45 +0000
@@ -260,7 +260,7 @@
if (_header.head_size >= 4) {
_mystery_word = *tmpptr++;
- _mystery_word = (_mystery_word << 12) + *tmpptr++;
+ _mystery_word = (_mystery_word << 8) + *tmpptr++;
_mystery_word = (_mystery_word << 8) + *tmpptr++;
log_debug(_("The mystery word is: %d"), _mystery_word);
@@ -268,7 +268,7 @@
if (_header.head_size >= 8) {
_header.bodysize = *tmpptr++;
- _header.bodysize = (_header.bodysize << 12) + *tmpptr++;
+ _header.bodysize = (_header.bodysize << 8) + *tmpptr++;
_header.bodysize = (_header.bodysize << 8) + *tmpptr++;
_header.bodysize = _header.bodysize & 0xffffff;
log_debug(_("The body size is: %d"), _header.bodysize);
@@ -381,17 +381,9 @@
// and add the type of the object if the header size is 8 or more.
// length is a 3 byte field
if ((head_size == HEADER_8) || (head_size == HEADER_12)) {
-#ifdef BOOST_BIG_ENDIAN
- boost::uint32_t length = total_size << 8;
-#else
- boost::uint32_t length = (htonl(*reinterpret_cast<boost::uint32_t
*>(&total_size))) >> 8;
-#endif
- memcpy(ptr, &length, 3);
-// #else
-// #error "No Endianess specified!"
-// #endif
-//#endif
- ptr += 3;
+ *ptr++ = (total_size >> 16) & 0xff;
+ *ptr++ = (total_size >> 8) & 0xff;
+ *ptr++ = total_size & 0xff;
// The type is a one byte field
*ptr = type;
ptr++;
@@ -399,7 +391,8 @@
// Add the routing of the message if the header size is 12, the maximum.
if (head_size == HEADER_12) {
- memcpy(ptr, &routing, 4);
+ boost::uint32_t swapped = htonl(routing);
+ memcpy(ptr, &swapped, 4);
ptr += 4;
}
=== modified file 'libnet/rtmp_server.cpp'
--- a/libnet/rtmp_server.cpp 2008-09-03 20:46:15 +0000
+++ b/libnet/rtmp_server.cpp 2008-10-21 21:34:45 +0000
@@ -628,11 +628,7 @@
Network::byte_t *ptr = buf->reference();
buf->clear(); // default everything to zeros, real data gets
optionally added.
- boost::uint32_t field = htonl(*reinterpret_cast<boost::uint32_t *>(&type));
-#ifdef BOOST_LITTLE_ENDIAN
- field = field >> 16;
-#endif
- boost::uint16_t typefield = static_cast<boost::uint16_t>(field);
+ boost::uint16_t typefield = htons(type);
ptr += sizeof(boost::uint16_t); // go past the first short
boost::uint32_t swapped = 0;
- [Gnash-commit] /srv/bzr/gnash/trunk r10043: Commit Andreas Schwab's bug fixes,
Russell Nelson <=