summaryrefslogtreecommitdiff
path: root/src/PeerConnection.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-27 16:06:34 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-09-27 16:06:34 +0000
commite9e215dc1f37827fabd87d6fb7ed99afa843d53a (patch)
tree6d469623c5b8a706f835aaebef53769736523eb9 /src/PeerConnection.cc
parent080fcd5fb81793cf53e5b5af8193df9440196ee1 (diff)
2008-09-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that HTTPS download fails. * src/AbstractCommand.cc * src/AbstractCommand.h * src/DownloadCommand.cc * src/FtpConnection.cc * src/HttpConnection.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/MSEHandshake.cc * src/PeerConnection.cc * src/SocketCore.cc * src/SocketCore.h Fixed the bug that aria2 doesn't download whole content body and cannot reuse connection if chunked transfer encoding and gzip content encoding are set. * src/DownloadCommand.cc * src/HttpSkipResponseCommand.cc
Diffstat (limited to 'src/PeerConnection.cc')
-rw-r--r--src/PeerConnection.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/PeerConnection.cc b/src/PeerConnection.cc
index 817255e7..8f6f9ae3 100644
--- a/src/PeerConnection.cc
+++ b/src/PeerConnection.cc
@@ -86,6 +86,9 @@ bool PeerConnection::receiveMessage(unsigned char* data, size_t& dataLength) {
size_t temp = remaining;
readData(lenbuf+lenbufLength, remaining, _encryptionEnabled);
if(remaining == 0) {
+ if(socket->wantRead() || socket->wantWrite()) {
+ return false;
+ }
// we got EOF
logger->debug("CUID#%d - In PeerConnection::receiveMessage(), remain=%zu",
cuid, temp);
@@ -111,6 +114,9 @@ bool PeerConnection::receiveMessage(unsigned char* data, size_t& dataLength) {
if(remaining > 0) {
readData(resbuf+resbufLength, remaining, _encryptionEnabled);
if(remaining == 0) {
+ if(socket->wantRead() || socket->wantWrite()) {
+ return false;
+ }
// we got EOF
logger->debug("CUID#%d - In PeerConnection::receiveMessage(), payloadlen=%zu, remaining=%zu",
cuid, currentPayloadLength, temp);
@@ -154,6 +160,9 @@ bool PeerConnection::receiveHandshake(unsigned char* data, size_t& dataLength,
size_t temp = remaining;
readData(resbuf+resbufLength, remaining, _encryptionEnabled);
if(remaining == 0) {
+ if(socket->wantRead() || socket->wantWrite()) {
+ return false;
+ }
// we got EOF
logger->debug("CUID#%d - In PeerConnection::receiveHandshake(), remain=%zu",
cuid, temp);