gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9875: return a NULL object when rece


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9875: return a NULL object when receiving an UNSUPPORTED one as data like red5 does.
Date: Sun, 21 Dec 2008 09:48:24 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9875
committer: address@hidden
branch nick: rtmp
timestamp: Sun 2008-12-21 09:48:24 -0700
message:
  return a NULL object when receiving an UNSUPPORTED one as data like red5 does.
modified:
  libnet/http.cpp
=== modified file 'libnet/http.cpp'
--- a/libnet/http.cpp   2008-12-20 20:44:51 +0000
+++ b/libnet/http.cpp   2008-12-21 16:48:24 +0000
@@ -1129,7 +1129,6 @@
 HTTP::formatEchoResponse(const std::string &num, amf::Element &el)
 {
     GNASH_REPORT_FUNCTION;
-
     boost::shared_ptr<amf::Buffer> data = amf::AMF::encodeElement(el);
     return formatEchoResponse(num, data->reference(), data->size());
 }
@@ -1179,8 +1178,17 @@
     // Add the other binary blob
     _buffer += fixme2;
 
-    // Add the AMF data we're echoing back
-    _buffer.append(data, size);
+    amf::Element::amf0_type_e type = 
static_cast<amf::Element::amf0_type_e>(*data);
+    if ((type == amf::Element::UNSUPPORTED_AMF0)
+       || (type == amf::Element::NULL_AMF0)) {
+       _buffer += type;
+       // Red5 returns a NULL object when it's recieved an undefined one in 
the echo_test
+    } else if (type == amf::Element::UNDEFINED_AMF0) {
+       _buffer += amf::Element::NULL_AMF0;
+    } else {
+       // Add the AMF data we're echoing back
+       _buffer.append(data, size);
+    }
     
     return _buffer;
 }


reply via email to

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