From 6497ed63d42042a249ea0233a3ef3b97b75f3db3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 19 May 2006 15:49:32 +0000 Subject: [PATCH] 2006-05-20 Tatsuhiro Tsujikawa * src/SocketCore.cc (isReadable): Added secure to the condition. * src/HttpConnection.cc (receiveResponse): Fixed a bug that causes no response header exception. * src/Peer.h (getFastSet): Fixed the return value type. --- ChangeLog | 10 ++++++++++ TODO | 4 +++- src/HttpConnection.cc | 1 + src/Peer.h | 2 +- src/SocketCore.cc | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2e5b5d9..7095f6f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-05-20 Tatsuhiro Tsujikawa + + * src/SocketCore.cc + (isReadable): Added secure to the condition. + * src/HttpConnection.cc + (receiveResponse): Fixed a bug that causes no response header + exception. + * src/Peer.h + (getFastSet): Fixed the return value type. + 2006-05-18 Tatsuhiro Tsujikawa To remove a wait from download loop: diff --git a/TODO b/TODO index 84f49741..f212ce0b 100644 --- a/TODO +++ b/TODO @@ -16,4 +16,6 @@ * Add announce-list support * Refacturing HttpConnection and FtpConnection * HTTP/FTP downloading regression test -* Fast extension test \ No newline at end of file +* Fast extension test +* send stop to the tracker when download finishes or ctrl-c enters. +* fix flooding detection \ No newline at end of file diff --git a/src/HttpConnection.cc b/src/HttpConnection.cc index 8542efde..d48b53f5 100644 --- a/src/HttpConnection.cc +++ b/src/HttpConnection.cc @@ -141,6 +141,7 @@ int HttpConnection::receiveResponse(HttpHeader& headers) { if((eohIndex = findEndOfHeader(headerBuf, "\r\n\r\n", hlenTemp)) == -1 && (eohIndex = findEndOfHeader(headerBuf, "\n\n", hlenTemp)) == -1) { socket->readData(headerBuf+headerBufLength, size); + headerBufLength += size; } else { if(eohIndex[headerBuf] == '\n') { // for crapping non-standard HTTP server diff --git a/src/Peer.h b/src/Peer.h index 6c6ed730..8958170f 100644 --- a/src/Peer.h +++ b/src/Peer.h @@ -130,7 +130,7 @@ public: bool isFastExtensionEnabled() const { return fastExtensionEnabled; } void addFastSetIndex(int index); - const Integers getFastSet() const { return fastSet; } + const Integers& getFastSet() const { return fastSet; } bool isInFastSet(int index) const; int countFastSet() const { return fastSet.size(); } diff --git a/src/SocketCore.cc b/src/SocketCore.cc index 2a8b54eb..160164f9 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -235,7 +235,7 @@ bool SocketCore::isWritable(int timeout) const { bool SocketCore::isReadable(int timeout) const { #ifdef HAVE_LIBGNUTLS - if(peekBufLength > 0) { + if(secure && peekBufLength > 0) { return true; } #endif // HAVE_LIBGNUTLS