gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r10037: add mergeChunks() to forcea m


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r10037: add mergeChunks() to forcea merge of all the buffers in the queue. Don't copy the chunked transfer header to the data.
Date: Wed, 25 Mar 2009 16:31:57 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10037
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2009-03-25 16:31:57 -0600
message:
  add mergeChunks() to forcea merge of all the buffers in the queue. Don't copy 
the chunked transfer header to the data.
modified:
  libnet/http.cpp
  libnet/http.h
=== modified file 'libnet/http.cpp'
--- a/libnet/http.cpp   2009-03-25 02:01:34 +0000
+++ b/libnet/http.cpp   2009-03-25 22:31:57 +0000
@@ -1378,7 +1378,7 @@
                  __PRETTY_FUNCTION__, total, size, sizesize);
        buf.reset(new amf::Buffer(total));
        // Add the existing data from the previous packet
-       buf->copy(data, size - sizesize);
+       buf->copy(data+sizesize, size-sizesize);
     }
 
     // The size of the packet we need to read has a 2 byte terminator "\r\n",
@@ -1405,6 +1405,7 @@
                buf.reset(new amf::Buffer(pktsize));
            }
            ret = readNet(buf->reference() + buf->allocated(), pktsize, 60);
+//         buf->dump();
            // We got data.
            if (ret == 0) {
                log_debug("no data yet for fd #%d, continuing...", getFileFd());
@@ -1436,7 +1437,6 @@
                            tmpbuf.copy(buf->reference() + bytes.size() + 2, 
(start - buf->reference()));
                            buf->resize(total);
                            buf->copy(tmpbuf.reference(), tmpbuf.size());
-                           tmpbuf. dump();
                        }
                    }
                }
@@ -1450,14 +1450,14 @@
                    if (pktsize == 0) {
                        done = true;
                    } else {
-                       log_debug("Didn't get a full packet, reading more 
data");
+//                     log_debug("Didn't get a full packet, reading more 
data");
                        continue;
                    }
                }
            }
        } while (!done);
-       log_debug("%s: finished packet, ret is %d, pktsize is %d\r\n%s", 
__PRETTY_FUNCTION__, ret, pktsize,
-                 hexify(buf->reference(), buf->allocated(), true));
+//     log_debug("%s: finished packet, ret is %d, pktsize is %d\r\n%s", 
__PRETTY_FUNCTION__, ret, pktsize,
+//               hexify(buf->reference(), buf->allocated(), true));
        if (pktsize == 0) {
            _que.push(buf);
        }

=== modified file 'libnet/http.h'
--- a/libnet/http.h     2009-03-25 02:00:52 +0000
+++ b/libnet/http.h     2009-03-25 22:31:57 +0000
@@ -299,6 +299,8 @@
     boost::shared_ptr<amf::Buffer> DSOEXPORT peekChunk() { return _que.peek(); 
};
     // Get the number of elements in the que
     size_t DSOEXPORT sizeChunks() { return _que.size(); };
+
+    boost::shared_ptr<amf::Buffer> DSOEXPORT mergeChunks() { return 
_que.merge(); };
     
 protected:
     // Examine the beginning of the data for an HTTP request command


reply via email to

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