Browse Source

2008-10-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Fixed the bug that causes time out when redirection occurs with
	content-length 0.
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/HttpSkipResponseCommand.h
Tatsuhiro Tsujikawa 17 years ago
parent
commit
d538c9ae97
4 changed files with 18 additions and 0 deletions
  1. 8 0
      ChangeLog
  2. 2 0
      src/HttpResponseCommand.cc
  3. 6 0
      src/HttpSkipResponseCommand.cc
  4. 2 0
      src/HttpSkipResponseCommand.h

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+2008-10-22  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	Fixed the bug that causes time out when redirection occurs with
+	content-length 0.
+	* src/HttpResponseCommand.cc
+	* src/HttpSkipResponseCommand.cc
+	* src/HttpSkipResponseCommand.h
+
 2008-10-22 Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 	Now each status legends is shown only when it appears in Download

+ 2 - 0
src/HttpResponseCommand.cc

@@ -290,6 +290,8 @@ bool HttpResponseCommand::skipResponseBody
   if(httpResponse->getEntityLength() == 0 &&
      !httpResponse->isTransferEncodingSpecified()) {
     command->setStatusRealtime();
+    // If entity length == 0, then socket read/write check must be disabled.
+    command->disableSocketCheck();
     e->setNoWait(true);
   }
 

+ 6 - 0
src/HttpSkipResponseCommand.cc

@@ -157,4 +157,10 @@ bool HttpSkipResponseCommand::processResponse()
   }
 }
 
+void HttpSkipResponseCommand::disableSocketCheck()
+{
+  disableReadCheckSocket();
+  disableWriteCheckSocket();
+}
+
 } // namespace aria2

+ 2 - 0
src/HttpSkipResponseCommand.h

@@ -70,6 +70,8 @@ public:
   virtual ~HttpSkipResponseCommand();
 
   void setTransferEncodingDecoder(const SharedHandle<Decoder>& decoder);
+
+  void disableSocketCheck();
 };
 
 } // namespace aria2