diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-09 19:30:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-09 19:30:21 +0000 |
commit | c877b55ca8dc9ab33058d753698edc907dc1dbcc (patch) | |
tree | e4a37ef29f83c60cc460eb0cd88ea7d129c848d0 /src/fs | |
parent | 8efb11939027e83fd74d92b8f0bf44b4f86aa4c3 (diff) | |
download | gnunet-c877b55ca8dc9ab33058d753698edc907dc1dbcc.tar.gz gnunet-c877b55ca8dc9ab33058d753698edc907dc1dbcc.zip |
-dequeue download on error, another attempt to fix #2403
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs_api.c | 8 | ||||
-rw-r--r-- | src/fs/fs_download.c | 5 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index ec959433a..4265d8d51 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c | |||
@@ -51,7 +51,7 @@ start_job (struct GNUNET_FS_QueueEntry *qe) | |||
51 | { | 51 | { |
52 | GNUNET_assert (NULL == qe->client); | 52 | GNUNET_assert (NULL == qe->client); |
53 | qe->client = GNUNET_CLIENT_connect ("fs", qe->h->cfg); | 53 | qe->client = GNUNET_CLIENT_connect ("fs", qe->h->cfg); |
54 | if (qe->client == NULL) | 54 | if (NULL == qe->client) |
55 | { | 55 | { |
56 | GNUNET_break (0); | 56 | GNUNET_break (0); |
57 | return; | 57 | return; |
@@ -114,7 +114,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
114 | while (NULL != (qe = next)) | 114 | while (NULL != (qe = next)) |
115 | { | 115 | { |
116 | next = qe->next; | 116 | next = qe->next; |
117 | if (h->running_head == NULL) | 117 | if (NULL == h->running_head) |
118 | { | 118 | { |
119 | start_job (qe); | 119 | start_job (qe); |
120 | continue; | 120 | continue; |
@@ -126,7 +126,7 @@ process_job_queue (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
126 | continue; | 126 | continue; |
127 | } | 127 | } |
128 | } | 128 | } |
129 | if (h->pending_head == NULL) | 129 | if (NULL == h->pending_head) |
130 | return; /* no need to stop anything */ | 130 | return; /* no need to stop anything */ |
131 | /* then, check if we should stop some jobs */ | 131 | /* then, check if we should stop some jobs */ |
132 | next = h->running_head; | 132 | next = h->running_head; |
@@ -221,7 +221,7 @@ GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh) | |||
221 | struct GNUNET_FS_Handle *h; | 221 | struct GNUNET_FS_Handle *h; |
222 | 222 | ||
223 | h = qh->h; | 223 | h = qh->h; |
224 | if (qh->client != NULL) | 224 | if (NULL != qh->client) |
225 | stop_job (qh); | 225 | stop_job (qh); |
226 | GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qh); | 226 | GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qh); |
227 | GNUNET_free (qh); | 227 | GNUNET_free (qh); |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index c7e3a6023..61178766b 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -1178,6 +1178,11 @@ signal_error: | |||
1178 | dc->top_request = NULL; | 1178 | dc->top_request = NULL; |
1179 | GNUNET_CONTAINER_multihashmap_destroy (dc->active); | 1179 | GNUNET_CONTAINER_multihashmap_destroy (dc->active); |
1180 | dc->active = NULL; | 1180 | dc->active = NULL; |
1181 | if (NULL != dc->job_queue) | ||
1182 | { | ||
1183 | GNUNET_FS_dequeue_ (dc->job_queue); | ||
1184 | dc->job_queue = NULL; | ||
1185 | } | ||
1181 | dc->pending_head = NULL; | 1186 | dc->pending_head = NULL; |
1182 | dc->pending_tail = NULL; | 1187 | dc->pending_tail = NULL; |
1183 | GNUNET_FS_download_sync_ (dc); | 1188 | GNUNET_FS_download_sync_ (dc); |