gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r10043: handle reading chunked messag


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r10043: handle reading chunked messages.
Date: Wed, 25 Mar 2009 16:36:02 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10043
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2009-03-25 16:36:02 -0600
message:
  handle reading chunked messages.
modified:
  libcore/asobj/NetConnection_as.cpp
=== modified file 'libcore/asobj/NetConnection_as.cpp'
--- a/libcore/asobj/NetConnection_as.cpp        2009-03-25 02:04:00 +0000
+++ b/libcore/asobj/NetConnection_as.cpp        2009-03-25 22:36:02 +0000
@@ -752,25 +752,34 @@
            if (chunked) {
                size_t count = http->recvChunked(data, (buf->end() - data));
                log_debug("Got %d chunked data messages", count);
-               chunk = http->popChunk();
            } else {
                done = true;
                result = false;
            }
        }
        
+//     for (size_t i=0; i<http->sizeChunks(); i++) {
        log_debug("Cookie is: \"%s\"", http->getField("cookie"));
        log_debug("Content type is: \"%s\"", http->getField("content-type"));
        if (http->getField("content-type").find("application/x-amf") != 
string::npos) {
+           if (chunked) {
+               chunk = http->mergeChunks();
+           } else {
+               chunk.reset(new amf::Buffer(buf->end() - data));
+               chunk->copy(data,(buf->end() - data));
+           }
+           
+//         chunk = http->popChunk();
+//         chunk->dump();
            amf::AMF_msg amsg;
            boost::shared_ptr<amf::AMF_msg::context_header_t> head =
-               amsg.parseAMFPacket(*chunk);
-           amsg.dump();
+               amsg.parseAMFPacket(chunk->reference(), chunk->allocated());
+//         amsg.dump();
            log_debug("%d messages in AMF packet", amsg.messageCount());
            for (size_t i=0; i<amsg.messageCount(); i++) {
-//             amsg.getMessage(i)->data->dump();
-               boost::shared_ptr<amf::Element> el = amsg.getMessage(i)->data;
-               as_value tmp(*el);
+//             amsg.getMessage(i)->data->dump();
+               boost::shared_ptr<amf::Element> el = amsg.getMessage(i)->data;
+               as_value tmp(*el);
 //             NetConnection_as *obj = (NetConnection_as *)args->network;
                log_debug("Calling NetConnection %s(%s)",
                          amsg.getMessage(i)->header.target, tmp);
@@ -788,7 +797,7 @@
                string_table::key methodKey;
                boost::mutex::scoped_lock lock(_nc_mutex);
                methodKey = args->st->find(methodName);
-               args->callback->callMethod(methodKey, tmp);
+               args->callback->callMethod(methodKey, tmp);
            }
        } else {        // not AMF data
            if ((http->getField("content-type").find("application/xml") != 
string::npos)


reply via email to

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