diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-03-15 15:07:18 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2007-03-15 15:07:18 +0000 |
| commit | 11907c175d9e3e6f4069df79dade320b6f93cd7f (patch) | |
| tree | d866782e0cc2a2eafd48ae3ac2612c280cdd6daa /src/HttpResponseCommand.h | |
| parent | ba7f9f765794bc197750253f07211c66afdd69e5 (diff) | |
2007-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To handle Segment as SegmentHandle:
* src/AbstractCommand.cc (execute): Rewritten.
* src/SegmentMan.h: Segment -> SegmentHandle
Introducded HttpResponse class, HttpRequest class to improve
code
extensiveness and make it clear:
* src/HttpDownloadCommand.cc: transfer encoders are now managed
by
HttpResponse class.
* src/HttpRequest.h, src/HttpRequest.cc: New class.
* src/HttpResponse.h, src/HttpResponse.cc: New class.
* src/HttpConnection.cc: Contruction of http request were moved
to
HttpRequest class.
* src/HttpResponseCommand.h, src/HttpResponseCommand.cc:
Refactored.
* src/HttpRequestCommand.cc (executeInternal): Rewritten.
* src/HttpAuthConfig.h: New class.
* src/Range.h: New class.
To make FtpTunnel{Request, Response}Command and
HttpProxy{Request, Response}Command derived from
AbstractProxy{Request, Response}Command:
* src/FtpTunnelResponseCommand.h,
src/FtpTunnelResponseCommand.cc:
Derived from AbstractProxyRequestCommand class.
* src/FtpTunnelRequestCommand.h, src/FtpTunnelRequestCommand.cc:
Derived from AbstractProxyResponseCommand class.
* src/HttpProxyRequestCommand.h, src/HttpProxyRequestCommand.cc:
Derived from AbstractProxyRequestCommand class.
* src/HttpProxyResponseCommand.h,
src/HttpProxyResponseCommand.cc:
Derived from AbstractProxyResponseCommand class.
* src/AbstractProxyRequestCommand.h,
src/AbstractProxyRequestCommand.cc
: New class.
* src/AbstractProxyResponseCommand.h,
src/AbstractProxyResponseCommand.cc: New class.
To add netrc support:
* src/Netrc.h, src/Netrc.cc: New class.
* src/Util.h, src/Util.cc (split): New function.
* src/HttpHeader.cc (getRange): Fixed so that it inspects
"Content-Range" header instead of "Range" header.
* src/HttpHeader.h
(getStatus): Removed.
(setStatus): Removed.
* src/Segment.h
(getPositionToWrite): New function.
Diffstat (limited to 'src/HttpResponseCommand.h')
| -rw-r--r-- | src/HttpResponseCommand.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/HttpResponseCommand.h b/src/HttpResponseCommand.h index 35b99697..00ec83c0 100644 --- a/src/HttpResponseCommand.h +++ b/src/HttpResponseCommand.h @@ -40,21 +40,19 @@ class HttpResponseCommand : public AbstractCommand { private: - void checkResponse(int status, const Segment& segment); - bool handleRedirect(const string& url, const HttpHeader& headers); - bool handleDefaultEncoding(const HttpHeader& headers); - bool handleOtherEncoding(const string& transferEncoding, const HttpHeader& headers); - void createHttpDownloadCommand(const string& transferEncoding = ""); - void retrieveCookie(const HttpHeader& headers); - /** - * Returned filename is URL-decoded. - */ - string determinFilename(const HttpHeader& headers); - HttpConnection* http; + HttpConnectionHandle httpConnection; + + bool handleDefaultEncoding(const HttpResponseHandle& httpResponse); + bool handleOtherEncoding(const HttpResponseHandle& httpResponse); + void createHttpDownloadCommand(const HttpResponseHandle& httpResponse); + bool doTorrentStuff(const HttpResponseHandle& httpResponse); protected: - bool executeInternal(Segment& segment); + bool executeInternal(); public: - HttpResponseCommand(int cuid, const RequestHandle req, DownloadEngine* e, + HttpResponseCommand(int32_t cuid, + const RequestHandle& req, + const HttpConnectionHandle& httpConnection, + DownloadEngine* e, const SocketHandle& s); ~HttpResponseCommand(); }; |
