aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-12-10 15:32:30 +0000
committerChristian Grothoff <christian@grothoff.org>2012-12-10 15:32:30 +0000
commit0f292c9b798f4442d2165756e6daf46d84bcb8b9 (patch)
treea128202e59f6a457d69085f52107a164d2511002
parent5d487c87d7c8a51c84ca7c41f08fb3cfc1ed6466 (diff)
downloadgnunet-0f292c9b798f4442d2165756e6daf46d84bcb8b9.tar.gz
gnunet-0f292c9b798f4442d2165756e6daf46d84bcb8b9.zip
-fix
-rw-r--r--src/fs/gnunet-service-fs_lc.c18
-rw-r--r--src/fs/gnunet-service-fs_stream.c17
2 files changed, 22 insertions, 13 deletions
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index fd29c81f9..c3b6f40b0 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -275,9 +275,14 @@ client_response_handler (void *cls, enum GNUNET_BLOCK_EvaluationResult eval,
275 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 275 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
276 "Queued reply to query `%s' for local client\n", 276 "Queued reply to query `%s' for local client\n",
277 GNUNET_h2s (&prd->query), (unsigned int) prd->type); 277 GNUNET_h2s (&prd->query), (unsigned int) prd->type);
278 if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST) 278 if (GNUNET_BLOCK_EVALUATION_OK_LAST != eval)
279 {
280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
281 "Evaluation %d - keeping query alive\n",
282 (int) eval);
279 return; 283 return;
280 if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task) 284 }
285 if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task)
281 cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, cr); 286 cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, cr);
282} 287}
283 288
@@ -480,18 +485,13 @@ GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client)
480 pos = client_head; 485 pos = client_head;
481 while ((pos != NULL) && (pos->client != client)) 486 while ((pos != NULL) && (pos->client != client))
482 pos = pos->next; 487 pos = pos->next;
483 if (pos == NULL) 488 if (NULL == pos)
484 return; 489 return;
485 while (NULL != (cr = pos->cr_head)) 490 while (NULL != (cr = pos->cr_head))
486 { 491 {
487 GNUNET_CONTAINER_DLL_remove (pos->cr_head, pos->cr_tail, cr);
488 GSF_pending_request_cancel_ (cr->pr, GNUNET_YES);
489 GNUNET_STATISTICS_update (GSF_stats,
490 gettext_noop ("# client searches active"), -1,
491 GNUNET_NO);
492 if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task) 492 if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task)
493 GNUNET_SCHEDULER_cancel (cr->kill_task); 493 GNUNET_SCHEDULER_cancel (cr->kill_task);
494 GNUNET_free (cr); 494 client_request_destroy (cr, NULL);
495 } 495 }
496 while (NULL != (res = pos->res_head)) 496 while (NULL != (res = pos->res_head))
497 { 497 {
diff --git a/src/fs/gnunet-service-fs_stream.c b/src/fs/gnunet-service-fs_stream.c
index 24aeaf888..e05616c45 100644
--- a/src/fs/gnunet-service-fs_stream.c
+++ b/src/fs/gnunet-service-fs_stream.c
@@ -1037,7 +1037,7 @@ continue_reading (struct StreamClient *sc)
1037 GNUNET_SERVER_mst_receive (sc->mst, 1037 GNUNET_SERVER_mst_receive (sc->mst,
1038 NULL, 1038 NULL,
1039 NULL, 0, 1039 NULL, 0,
1040 GNUNET_NO, GNUNET_YES); 1040 GNUNET_NO, GNUNET_NO);
1041 if (GNUNET_NO == ret) 1041 if (GNUNET_NO == ret)
1042 return; 1042 return;
1043 refresh_timeout_task (sc); 1043 refresh_timeout_task (sc);
@@ -1088,7 +1088,7 @@ process_request (void *cls,
1088 GNUNET_SERVER_mst_receive (sc->mst, 1088 GNUNET_SERVER_mst_receive (sc->mst,
1089 NULL, 1089 NULL,
1090 data, size, 1090 data, size,
1091 GNUNET_NO, GNUNET_YES); 1091 GNUNET_NO, GNUNET_NO);
1092 if (GNUNET_NO == ret) 1092 if (GNUNET_NO == ret)
1093 return size; /* more messages in MST */ 1093 return size; /* more messages in MST */
1094 if (GNUNET_SYSERR == ret) 1094 if (GNUNET_SYSERR == ret)
@@ -1219,6 +1219,8 @@ handle_datastore_reply (void *cls,
1219 sc->qe = NULL; 1219 sc->qe = NULL;
1220 if (GNUNET_BLOCK_TYPE_FS_ONDEMAND == type) 1220 if (GNUNET_BLOCK_TYPE_FS_ONDEMAND == type)
1221 { 1221 {
1222 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1223 "Performing on-demand encoding\n");
1222 if (GNUNET_OK != 1224 if (GNUNET_OK !=
1223 GNUNET_FS_handle_on_demand_block (key, 1225 GNUNET_FS_handle_on_demand_block (key,
1224 size, data, type, 1226 size, data, type,
@@ -1227,6 +1229,8 @@ handle_datastore_reply (void *cls,
1227 &handle_datastore_reply, 1229 &handle_datastore_reply,
1228 sc)) 1230 sc))
1229 { 1231 {
1232 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1233 "On-demand encoding request failed\n");
1230 continue_writing (sc); 1234 continue_writing (sc);
1231 } 1235 }
1232 return; 1236 return;
@@ -1238,8 +1242,9 @@ handle_datastore_reply (void *cls,
1238 return; 1242 return;
1239 } 1243 }
1240 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1244 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1241 "Starting transmission of %u byte reply via stream\n", 1245 "Starting transmission of %u byte reply for query `%s' via stream\n",
1242 (unsigned int) size); 1246 (unsigned int) size,
1247 GNUNET_h2s (key));
1243 wqi = GNUNET_malloc (sizeof (struct WriteQueueItem) + msize); 1248 wqi = GNUNET_malloc (sizeof (struct WriteQueueItem) + msize);
1244 wqi->msize = msize; 1249 wqi->msize = msize;
1245 srm = (struct StreamReplyMessage *) &wqi[1]; 1250 srm = (struct StreamReplyMessage *) &wqi[1];
@@ -1302,7 +1307,11 @@ request_cb (void *cls,
1302 GNUNET_TIME_UNIT_FOREVER_REL, 1307 GNUNET_TIME_UNIT_FOREVER_REL,
1303 &handle_datastore_reply, sc); 1308 &handle_datastore_reply, sc);
1304 if (NULL == sc->qe) 1309 if (NULL == sc->qe)
1310 {
1311 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1312 "Queueing request with datastore failed (queue full?)\n");
1305 continue_writing (sc); 1313 continue_writing (sc);
1314 }
1306 return GNUNET_OK; 1315 return GNUNET_OK;
1307 default: 1316 default:
1308 GNUNET_break_op (0); 1317 GNUNET_break_op (0);