summaryrefslogtreecommitdiff
path: root/src/HttpRequestCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-01-16 16:55:41 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-01-16 16:55:41 +0900
commitea1b4b3ee533146763245ecbbb4a31e3ed791498 (patch)
tree5dfda14ff291403bcee9b24380c1e47673b8a98b /src/HttpRequestCommand.cc
parent602a9d6ba3f8ee38c25448796ad51992f971da8c (diff)
Eliminated SocketCore::peekData() form HTTP/FTP downloads.
We introduced SocketRecvBuffer which buffers received bytes. Since HTTP response header and response body are divided with \r\n, we have to buffer up several bytes to find this delimiter. We use SocketRecvBuffer to hold these bytes and only consumes header and passes SocketRecvBuffer, which may contain head of response body, to next Command. Since FTPConnection doesn't use SocketCore::peekData(), we left it as is.
Diffstat (limited to 'src/HttpRequestCommand.cc')
-rw-r--r--src/HttpRequestCommand.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/HttpRequestCommand.cc b/src/HttpRequestCommand.cc
index a16e7691..b9146760 100644
--- a/src/HttpRequestCommand.cc
+++ b/src/HttpRequestCommand.cc
@@ -58,6 +58,7 @@
#include "Logger.h"
#include "LogFactory.h"
#include "fmt.h"
+#include "SocketRecvBuffer.h"
namespace aria2 {
@@ -69,7 +70,8 @@ HttpRequestCommand::HttpRequestCommand
const HttpConnectionHandle& httpConnection,
DownloadEngine* e,
const SocketHandle& s)
- : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s),
+ : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s,
+ httpConnection->getSocketRecvBuffer()),
httpConnection_(httpConnection)
{
setTimeout(getOption()->getAsInt(PREF_CONNECT_TIMEOUT));