diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-02-21 12:27:17 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-02-21 12:27:17 +0000 |
| commit | 5a8710676d58be3b3f3606993e802c6a075dbd89 (patch) | |
| tree | 634e1f7be2dffb00c4248323c1465f22aedb6f60 /src/HttpProxyResponseCommand.cc | |
| parent | 6d6f25b75c1557f2b92e51fe589aadc48a1fdb68 (diff) | |
Diffstat (limited to 'src/HttpProxyResponseCommand.cc')
| -rw-r--r-- | src/HttpProxyResponseCommand.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/HttpProxyResponseCommand.cc b/src/HttpProxyResponseCommand.cc index e62d3939..cb2764b9 100644 --- a/src/HttpProxyResponseCommand.cc +++ b/src/HttpProxyResponseCommand.cc @@ -22,19 +22,24 @@ #include "HttpProxyResponseCommand.h" #include "HttpRequestCommand.h" #include "DlRetryEx.h" -#include "HttpConnection.h" #include "message.h" HttpProxyResponseCommand::HttpProxyResponseCommand(int cuid, Request* req, DownloadEngine* e, Socket* s):AbstractCommand(cuid, req, e, s) { - AbstractCommand::checkSocketIsReadable = true; + http = new HttpConnection(cuid, socket, req, e->option, e->logger); } -HttpProxyResponseCommand::~HttpProxyResponseCommand() {} +HttpProxyResponseCommand::~HttpProxyResponseCommand() { + delete http; +} bool HttpProxyResponseCommand::executeInternal(Segment segment) { HttpHeader headers; - HttpConnection httpConnection(cuid, socket, e->option, e->logger); - int status = httpConnection.receiveResponse(headers); + int status = http->receiveResponse(headers); + if(status == 0) { + // we didn't receive all of headers yet. + e->commands.push(this); + return false; + } if(status != 200) { throw new DlRetryEx(EX_PROXY_CONNECTION_FAILED); } |
