diff options
author | pixel <pixel> | 2008-07-22 14:31:32 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-07-22 14:31:32 +0000 |
commit | 8ae64c2ffc5fdb13c74388a7a7820e429941a021 (patch) | |
tree | b89c11f258230707a9732e2c2423822df5fa9f39 /lib/HttpClient.cc | |
parent | ed9d185968ebc7a3ef1a570e0574e3ab72141c86 (diff) |
Fixing HttpClient in case of less specific URLs.
Diffstat (limited to 'lib/HttpClient.cc')
-rw-r--r-- | lib/HttpClient.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/HttpClient.cc b/lib/HttpClient.cc index 8ae5248..19d30ef 100644 --- a/lib/HttpClient.cc +++ b/lib/HttpClient.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: HttpClient.cc,v 1.18 2008-02-15 15:10:22 pixel Exp $ */ +/* $Id: HttpClient.cc,v 1.19 2008-07-22 14:31:32 pixel Exp $ */ #include <TaskMan.h> #include <HttpClient.h> @@ -28,7 +28,7 @@ t_headers no_headers; -const timeval timeout = { 8, 0 }; +const timeval timeout = { 12000, 0 }; HttpClient::HttpClient(const String & _url, Handle * _out, const String & _fake_host, t_headers _headers, const Variables & _vars) : url(_url), out(_out), fake_host(_fake_host), headers(_headers), vars(_vars), host(""), uri("") { int p; @@ -249,10 +249,14 @@ void HttpClient::DecodeURL() throw (GeneralException) { p = tmp.strchr('/'); if (p < 0) { - host = tmp; + host = tmp.trim(); + uri = "/"; return; } - host = tmp.extract(0, p - 1); - uri = tmp.extract(p); + host = tmp.extract(0, p - 1).trim(); + uri = tmp.extract(p).trim(); + if (uri == "") { + uri = "/"; + } } |