From: Christian Grothoff Date: Mon, 3 May 2010 09:03:08 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~21919 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2d215723e30ee9af322ed6b243b24feab630845b;p=oweals%2Fgnunet.git fix --- diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index eba58e7a5..31984da08 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -826,6 +826,8 @@ process_result_with_request (void *cls, { struct ProcessResultClosure *prc = cls; struct DownloadRequest *sm = value; + struct DownloadRequest *ppos; + struct DownloadRequest *pprev; struct GNUNET_FS_DownloadContext *dc = prc->dc; struct GNUNET_CRYPTO_AesSessionKey skey; struct GNUNET_CRYPTO_AesInitializationVector iv; @@ -869,6 +871,22 @@ process_result_with_request (void *cls, GNUNET_CONTAINER_multihashmap_remove (dc->active, &prc->query, sm)); + /* if this request is on the pending list, remove it! */ + pprev = NULL; + ppos = dc->pending; + while (ppos != NULL) + { + if (ppos == sm) + { + if (pprev == NULL) + dc->pending = ppos->next; + else + pprev->next = ppos->next; + break; + } + pprev = ppos; + ppos = ppos->next; + } GNUNET_CRYPTO_hash_to_aes_key (&sm->chk.key, &skey, &iv); GNUNET_CRYPTO_aes_decrypt (prc->data, prc->size,