From a99408217ff9a1095488cb302596450485bfd2ff Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 21 Jan 2008 04:04:22 +0000 Subject: Consolidating HttpClient a bit. --- lib/HttpClient.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/HttpClient.cc b/lib/HttpClient.cc index 76bbdf6..adaf3cc 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.15 2008-01-07 23:38:14 pixel Exp $ */ +/* $Id: HttpClient.cc,v 1.16 2008-01-21 04:04:22 pixel Exp $ */ #include #include @@ -108,6 +108,7 @@ int HttpClient::Do() throw (GeneralException) { case 1: delete c; + c = 0; if (TaskMan::Event() == Task::EVT_TIMEOUT) { status = "Connection timeout."; @@ -123,6 +124,7 @@ int HttpClient::Do() throw (GeneralException) { case 2: delete c; + c = 0; if (TaskMan::Event() == Task::EVT_TIMEOUT) { status = "Connection timeout."; @@ -167,8 +169,10 @@ int HttpClient::Do() throw (GeneralException) { c = 0; case 3: - if (c) + if (c) { delete c; + c = 0; + } if (TaskMan::Event() == Task::EVT_TIMEOUT) { status = "Connection timeout."; @@ -184,6 +188,7 @@ int HttpClient::Do() throw (GeneralException) { case 4: delete c; + c = 0; if (TaskMan::Event() == Task::EVT_TIMEOUT) { status = "Connection timeout."; @@ -213,7 +218,14 @@ int HttpClient::Do() throw (GeneralException) { case 5: delete c; + c = 0; + if (TaskMan::Event() == Task::EVT_TIMEOUT) { + status = "Connection timeout."; + return TASK_DONE; + } + RemoveTimeout(); + status = "Downloaded."; return TASK_DONE; } -- cgit v1.2.3