summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/HttpClient.cc16
1 files 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 <TaskMan.h>
#include <HttpClient.h>
@@ -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;
}