aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-31 11:31:30 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-31 11:31:30 +0000
commit5c471ef07d3ac0eee0b426d6324073eef1e97220 (patch)
tree0bc5620a147c3c390f06fcfc5aca591bf0b243b1 /src
parent9adc472823bd282e1e7e560d16da1e7966b3634b (diff)
downloadgnunet-5c471ef07d3ac0eee0b426d6324073eef1e97220.tar.gz
gnunet-5c471ef07d3ac0eee0b426d6324073eef1e97220.zip
logging
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs_download.c34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 50edcb256..ff3eb09e1 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -339,6 +339,10 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc,
339 &chk->query, 339 &chk->query,
340 sizeof (GNUNET_HashCode))) 340 sizeof (GNUNET_HashCode)))
341 { 341 {
342#if DEBUG_DOWNLOAD
343 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
344 "Matching block already present, no need for download!\n");
345#endif
342 /* already got it! */ 346 /* already got it! */
343 prc.dc = dc; 347 prc.dc = dc;
344 prc.data = enc; 348 prc.data = enc;
@@ -373,12 +377,18 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc,
373 377
374 if ( (dc->th == NULL) && 378 if ( (dc->th == NULL) &&
375 (dc->client != NULL) ) 379 (dc->client != NULL) )
376 dc->th = GNUNET_CLIENT_notify_transmit_ready (dc->client, 380 {
377 sizeof (struct SearchMessage), 381#if DEBUG_DOWNLOAD
378 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 382 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
379 GNUNET_NO, 383 "Asking for transmission to FS service\n");
380 &transmit_download_request, 384#endif
381 dc); 385 dc->th = GNUNET_CLIENT_notify_transmit_ready (dc->client,
386 sizeof (struct SearchMessage),
387 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
388 GNUNET_NO,
389 &transmit_download_request,
390 dc);
391 }
382} 392}
383 393
384 394
@@ -1202,6 +1212,10 @@ transmit_download_request (void *cls,
1202 dc->th = NULL; 1212 dc->th = NULL;
1203 if (NULL == buf) 1213 if (NULL == buf)
1204 { 1214 {
1215#if DEBUG_DOWNLOAD
1216 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1217 "Transmitting download request failed, trying to reconnect\n");
1218#endif
1205 try_reconnect (dc); 1219 try_reconnect (dc);
1206 return 0; 1220 return 0;
1207 } 1221 }
@@ -1325,6 +1339,10 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc)
1325 1339
1326 if (NULL != dc->client) 1340 if (NULL != dc->client)
1327 { 1341 {
1342#if DEBUG_DOWNLOAD
1343 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1344 "Moving all requests back to pending list\n");
1345#endif
1328 if (NULL != dc->th) 1346 if (NULL != dc->th)
1329 { 1347 {
1330 GNUNET_CLIENT_notify_transmit_ready_cancel (dc->th); 1348 GNUNET_CLIENT_notify_transmit_ready_cancel (dc->th);
@@ -1336,6 +1354,10 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc)
1336 GNUNET_CLIENT_disconnect (dc->client, GNUNET_NO); 1354 GNUNET_CLIENT_disconnect (dc->client, GNUNET_NO);
1337 dc->client = NULL; 1355 dc->client = NULL;
1338 } 1356 }
1357#if DEBUG_DOWNLOAD
1358 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1359 "Will try to reconnect in 1s\n");
1360#endif
1339 dc->task 1361 dc->task
1340 = GNUNET_SCHEDULER_add_delayed (dc->h->sched, 1362 = GNUNET_SCHEDULER_add_delayed (dc->h->sched,
1341 GNUNET_TIME_UNIT_SECONDS, 1363 GNUNET_TIME_UNIT_SECONDS,