[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r10046: remove the trailing \r\n that
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r10046: remove the trailing \r\n that terminates the HTTP chunk, as it shouldn't be in the binary blob. |
Date: |
Thu, 26 Mar 2009 10:40:48 -0600 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10046
committer: address@hidden
branch nick: rtmp
timestamp: Thu 2009-03-26 10:40:48 -0600
message:
remove the trailing \r\n that terminates the HTTP chunk, as it shouldn't be
in the binary blob.
modified:
libnet/http.cpp
=== modified file 'libnet/http.cpp'
--- a/libnet/http.cpp 2009-03-25 22:31:57 +0000
+++ b/libnet/http.cpp 2009-03-26 16:40:48 +0000
@@ -1405,7 +1405,7 @@
buf.reset(new amf::Buffer(pktsize));
}
ret = readNet(buf->reference() + buf->allocated(), pktsize, 60);
-// buf->dump();
+ //buf->dump();
// We got data.
if (ret == 0) {
log_debug("no data yet for fd #%d, continuing...", getFileFd());
@@ -1435,14 +1435,12 @@
amf::Buffer tmpbuf(start - buf->reference());
// don't forget the two bytes for the "\r\n"
tmpbuf.copy(buf->reference() + bytes.size() + 2,
(start - buf->reference()));
+ buf->clear(); // FIXME: debug only
buf->resize(total);
buf->copy(tmpbuf.reference(), tmpbuf.size());
}
}
}
- if (ret < pktsize) {
-
- }
// If we got less data than specified, we need to keep reading
data
if (ret < buf->size()) {
@@ -1459,6 +1457,11 @@
// 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) {
+ // The last two bytes of the chunk are always "\r\n", which we
remove so it
+ // doesn't become part of the binary data being sent in the chunk.
+ *(buf->end()-1) = 0;
+ *(buf->end()-2) = 0;
+ buf->setSeekPointer(buf->end() - 2);
_que.push(buf);
}
done = false; // reset
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r10046: remove the trailing \r\n that terminates the HTTP chunk, as it shouldn't be in the binary blob.,
rob <=