gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9591: Fix encoding the type for big


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9591: Fix encoding the type for big endian.
Date: Wed, 20 Aug 2008 10:31:57 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9591
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2008-08-20 10:31:57 -0600
message:
  Fix encoding the type for big endian.
modified:
  libnet/rtmp_server.cpp
=== modified file 'libnet/rtmp_server.cpp'
--- a/libnet/rtmp_server.cpp    2008-08-14 04:24:41 +0000
+++ b/libnet/rtmp_server.cpp    2008-08-20 16:31:57 +0000
@@ -619,15 +619,16 @@
 amf::Buffer *
 RTMPServer::encodePing(rtmp_ping_e type, boost::uint32_t milliseconds)
 {
-    GNASH_REPORT_FUNCTION;
+//    GNASH_REPORT_FUNCTION;
     Buffer *buf = new Buffer(sizeof(boost::uint16_t) * 4);
     Network::byte_t *ptr = buf->reference();
-    buf->clear();              // default everything to zeros, real data gets 
optionally added.
-    boost::uint16_t typefield = *reinterpret_cast<boost::uint16_t *>(&type);
+    // default everything to zeros, real data gets optionally added.
+    buf->clear();
+//    boost::uint16_t typefield = (reinterpret_cast<boost::uint16_t>(type));
+    boost::uint16_t typefield = ntohs(type);
     ptr += sizeof(boost::uint16_t); // go past the first short
-
     boost::uint32_t swapped = 0;
-    swapBytes(&typefield, sizeof(boost::uint16_t));
+//     swapBytes(&typefield, sizeof(boost::uint16_t));
     buf->copy(typefield);
     switch (type) {
         // These two don't appear to have any paramaters


reply via email to

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