mirror of
https://github.com/aria2/aria2.git
synced 2025-04-07 06:27:37 +03:00
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.
This commit is contained in:
parent
602a9d6ba3
commit
ea1b4b3ee5
30 changed files with 412 additions and 143 deletions
|
@ -71,6 +71,7 @@
|
|||
#include "SinkStreamFilter.h"
|
||||
#include "ChunkedDecodingStreamFilter.h"
|
||||
#include "uri.h"
|
||||
#include "SocketRecvBuffer.h"
|
||||
#ifdef HAVE_LIBZ
|
||||
# include "GZipDecodingStreamFilter.h"
|
||||
#endif // HAVE_LIBZ
|
||||
|
@ -134,9 +135,12 @@ HttpResponseCommand::HttpResponseCommand
|
|||
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)
|
||||
{}
|
||||
{
|
||||
checkSocketRecvBuffer();
|
||||
}
|
||||
|
||||
HttpResponseCommand::~HttpResponseCommand() {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue