diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-07 20:42:45 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-07 20:42:45 +0000 |
commit | 9ff5a5b4713dfefc3b42b66fb3865b1435667a77 (patch) | |
tree | 32e68fea6101b72732118136dc371b5a8c937eb2 | |
parent | 83a9103243b5fd0aa5924956ae0249a1273b062d (diff) | |
download | gnunet-9ff5a5b4713dfefc3b42b66fb3865b1435667a77.tar.gz gnunet-9ff5a5b4713dfefc3b42b66fb3865b1435667a77.zip |
fix
-rw-r--r-- | src/core/core_api.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index 1e37c91c2..a995eb27f 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -274,6 +274,8 @@ timeout_request (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
274 | struct GNUNET_CORE_TransmitHandle *th = cls; | 274 | struct GNUNET_CORE_TransmitHandle *th = cls; |
275 | struct GNUNET_CORE_Handle *h; | 275 | struct GNUNET_CORE_Handle *h; |
276 | 276 | ||
277 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
278 | "Transmission request timed out.\n"); | ||
277 | h = th->ch; | 279 | h = th->ch; |
278 | th->timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; | 280 | th->timeout_task = GNUNET_SCHEDULER_NO_PREREQUISITE_TASK; |
279 | GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL)); | 281 | GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL)); |
@@ -966,12 +968,22 @@ produce_send (void *cls, size_t size, void *buf) | |||
966 | if (buf == NULL) | 968 | if (buf == NULL) |
967 | { | 969 | { |
968 | /* timeout or error */ | 970 | /* timeout or error */ |
971 | #if DEBUG_CORE | ||
972 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
973 | "P2P transmission request for `%4s' timed out.\n", | ||
974 | GNUNET_i2s(&th->peer)); | ||
975 | #endif | ||
969 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); | 976 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); |
970 | if (th->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) | 977 | if (th->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK) |
971 | GNUNET_CORE_notify_transmit_ready_cancel (th); | 978 | GNUNET_CORE_notify_transmit_ready_cancel (th); |
972 | trigger_next_request (h); | 979 | trigger_next_request (h); |
973 | return 0; | 980 | return 0; |
974 | } | 981 | } |
982 | #if DEBUG_CORE | ||
983 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
984 | "Preparing for P2P transmission to `%4s'.\n", | ||
985 | GNUNET_i2s(&th->peer)); | ||
986 | #endif | ||
975 | GNUNET_assert (th->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); | 987 | GNUNET_assert (th->timeout_task != GNUNET_SCHEDULER_NO_PREREQUISITE_TASK); |
976 | sm = (struct SendMessage *) buf; | 988 | sm = (struct SendMessage *) buf; |
977 | sm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND); | 989 | sm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND); |
@@ -1046,7 +1058,7 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, | |||
1046 | /* was the request queue previously empty? */ | 1058 | /* was the request queue previously empty? */ |
1047 | if (handle->pending_head == th) | 1059 | if (handle->pending_head == th) |
1048 | trigger_next_request (handle); | 1060 | trigger_next_request (handle); |
1049 | return NULL; | 1061 | return th; |
1050 | } | 1062 | } |
1051 | 1063 | ||
1052 | 1064 | ||