diff options
Diffstat (limited to 'src/nse/gnunet-service-nse.c')
-rw-r--r-- | src/nse/gnunet-service-nse.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 317750b70..e83e94eb0 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c | |||
@@ -130,7 +130,7 @@ struct NSEPeerEntry | |||
130 | /** | 130 | /** |
131 | * Task scheduled to send message to this peer. | 131 | * Task scheduled to send message to this peer. |
132 | */ | 132 | */ |
133 | GNUNET_SCHEDULER_TaskIdentifier transmit_task; | 133 | struct GNUNET_SCHEDULER_Task * transmit_task; |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * Did we receive or send a message about the previous round | 136 | * Did we receive or send a message about the previous round |
@@ -275,12 +275,12 @@ static unsigned int estimate_count; | |||
275 | /** | 275 | /** |
276 | * Task scheduled to update our flood message for the next round. | 276 | * Task scheduled to update our flood message for the next round. |
277 | */ | 277 | */ |
278 | static GNUNET_SCHEDULER_TaskIdentifier flood_task; | 278 | static struct GNUNET_SCHEDULER_Task * flood_task; |
279 | 279 | ||
280 | /** | 280 | /** |
281 | * Task scheduled to compute our proof. | 281 | * Task scheduled to compute our proof. |
282 | */ | 282 | */ |
283 | static GNUNET_SCHEDULER_TaskIdentifier proof_task; | 283 | static struct GNUNET_SCHEDULER_Task * proof_task; |
284 | 284 | ||
285 | /** | 285 | /** |
286 | * Notification context, simplifies client broadcasts. | 286 | * Notification context, simplifies client broadcasts. |
@@ -635,7 +635,7 @@ transmit_ready (void *cls, | |||
635 | peer_entry); | 635 | peer_entry); |
636 | } | 636 | } |
637 | if ((0 == ntohl (size_estimate_messages[idx].hop_count)) && | 637 | if ((0 == ntohl (size_estimate_messages[idx].hop_count)) && |
638 | (GNUNET_SCHEDULER_NO_TASK != proof_task)) | 638 | (NULL != proof_task)) |
639 | { | 639 | { |
640 | GNUNET_STATISTICS_update (stats, | 640 | GNUNET_STATISTICS_update (stats, |
641 | "# flood messages not generated (no proof yet)", | 641 | "# flood messages not generated (no proof yet)", |
@@ -681,7 +681,7 @@ transmit_task_cb (void *cls, | |||
681 | { | 681 | { |
682 | struct NSEPeerEntry *peer_entry = cls; | 682 | struct NSEPeerEntry *peer_entry = cls; |
683 | 683 | ||
684 | peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; | 684 | peer_entry->transmit_task = NULL; |
685 | 685 | ||
686 | GNUNET_assert (NULL == peer_entry->th); | 686 | GNUNET_assert (NULL == peer_entry->th); |
687 | peer_entry->th = | 687 | peer_entry->th = |
@@ -772,7 +772,7 @@ schedule_current_round (void *cls, | |||
772 | peer_entry->previous_round = GNUNET_NO; | 772 | peer_entry->previous_round = GNUNET_NO; |
773 | return GNUNET_OK; | 773 | return GNUNET_OK; |
774 | } | 774 | } |
775 | if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task) | 775 | if (NULL != peer_entry->transmit_task) |
776 | { | 776 | { |
777 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); | 777 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); |
778 | peer_entry->previous_round = GNUNET_NO; | 778 | peer_entry->previous_round = GNUNET_NO; |
@@ -806,7 +806,7 @@ update_flood_message (void *cls, | |||
806 | struct GNUNET_TIME_Relative offset; | 806 | struct GNUNET_TIME_Relative offset; |
807 | unsigned int i; | 807 | unsigned int i; |
808 | 808 | ||
809 | flood_task = GNUNET_SCHEDULER_NO_TASK; | 809 | flood_task = NULL; |
810 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 810 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
811 | return; | 811 | return; |
812 | offset = GNUNET_TIME_absolute_get_remaining (next_timestamp); | 812 | offset = GNUNET_TIME_absolute_get_remaining (next_timestamp); |
@@ -931,7 +931,7 @@ find_proof (void *cls, | |||
931 | struct GNUNET_HashCode result; | 931 | struct GNUNET_HashCode result; |
932 | unsigned int i; | 932 | unsigned int i; |
933 | 933 | ||
934 | proof_task = GNUNET_SCHEDULER_NO_TASK; | 934 | proof_task = NULL; |
935 | memcpy (&buf[sizeof (uint64_t)], &my_identity, | 935 | memcpy (&buf[sizeof (uint64_t)], &my_identity, |
936 | sizeof (struct GNUNET_PeerIdentity)); | 936 | sizeof (struct GNUNET_PeerIdentity)); |
937 | i = 0; | 937 | i = 0; |
@@ -1034,17 +1034,17 @@ update_flood_times (void *cls, | |||
1034 | { | 1034 | { |
1035 | /* still stuck in previous round, no point to update, check that | 1035 | /* still stuck in previous round, no point to update, check that |
1036 | * we are active here though... */ | 1036 | * we are active here though... */ |
1037 | if ( (GNUNET_SCHEDULER_NO_TASK == peer_entry->transmit_task) && | 1037 | if ( (NULL == peer_entry->transmit_task) && |
1038 | (NULL == peer_entry->th) ) | 1038 | (NULL == peer_entry->th) ) |
1039 | { | 1039 | { |
1040 | GNUNET_break (0); | 1040 | GNUNET_break (0); |
1041 | } | 1041 | } |
1042 | return GNUNET_OK; | 1042 | return GNUNET_OK; |
1043 | } | 1043 | } |
1044 | if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task) | 1044 | if (NULL != peer_entry->transmit_task) |
1045 | { | 1045 | { |
1046 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); | 1046 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); |
1047 | peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; | 1047 | peer_entry->transmit_task = NULL; |
1048 | } | 1048 | } |
1049 | delay = get_transmit_delay (0); | 1049 | delay = get_transmit_delay (0); |
1050 | peer_entry->transmit_task = | 1050 | peer_entry->transmit_task = |
@@ -1169,10 +1169,10 @@ handle_p2p_size_estimate (void *cls, | |||
1169 | } | 1169 | } |
1170 | /* got up-to-date information for current round, cancel transmission to | 1170 | /* got up-to-date information for current round, cancel transmission to |
1171 | * this peer altogether */ | 1171 | * this peer altogether */ |
1172 | if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task) | 1172 | if (NULL != peer_entry->transmit_task) |
1173 | { | 1173 | { |
1174 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); | 1174 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); |
1175 | peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; | 1175 | peer_entry->transmit_task = NULL; |
1176 | } | 1176 | } |
1177 | if (NULL != peer_entry->th) | 1177 | if (NULL != peer_entry->th) |
1178 | { | 1178 | { |
@@ -1189,7 +1189,7 @@ handle_p2p_size_estimate (void *cls, | |||
1189 | /* push back our result now, that peer is spreading bad information... */ | 1189 | /* push back our result now, that peer is spreading bad information... */ |
1190 | if (NULL == peer_entry->th) | 1190 | if (NULL == peer_entry->th) |
1191 | { | 1191 | { |
1192 | if (peer_entry->transmit_task != GNUNET_SCHEDULER_NO_TASK) | 1192 | if (peer_entry->transmit_task != NULL) |
1193 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); | 1193 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); |
1194 | peer_entry->transmit_task = | 1194 | peer_entry->transmit_task = |
1195 | GNUNET_SCHEDULER_add_now (&transmit_task_cb, peer_entry); | 1195 | GNUNET_SCHEDULER_add_now (&transmit_task_cb, peer_entry); |
@@ -1214,10 +1214,10 @@ handle_p2p_size_estimate (void *cls, | |||
1214 | if (idx == estimate_index) | 1214 | if (idx == estimate_index) |
1215 | { | 1215 | { |
1216 | /* cancel any activity for current round */ | 1216 | /* cancel any activity for current round */ |
1217 | if (peer_entry->transmit_task != GNUNET_SCHEDULER_NO_TASK) | 1217 | if (peer_entry->transmit_task != NULL) |
1218 | { | 1218 | { |
1219 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); | 1219 | GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); |
1220 | peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; | 1220 | peer_entry->transmit_task = NULL; |
1221 | } | 1221 | } |
1222 | if (peer_entry->th != NULL) | 1222 | if (peer_entry->th != NULL) |
1223 | { | 1223 | { |
@@ -1303,9 +1303,9 @@ handle_core_disconnect (void *cls, | |||
1303 | GNUNET_assert (GNUNET_YES == | 1303 | GNUNET_assert (GNUNET_YES == |
1304 | GNUNET_CONTAINER_multipeermap_remove (peers, peer, | 1304 | GNUNET_CONTAINER_multipeermap_remove (peers, peer, |
1305 | pos)); | 1305 | pos)); |
1306 | if (pos->transmit_task != GNUNET_SCHEDULER_NO_TASK) { | 1306 | if (pos->transmit_task != NULL) { |
1307 | GNUNET_SCHEDULER_cancel (pos->transmit_task); | 1307 | GNUNET_SCHEDULER_cancel (pos->transmit_task); |
1308 | pos->transmit_task = GNUNET_SCHEDULER_NO_TASK; | 1308 | pos->transmit_task = NULL; |
1309 | } | 1309 | } |
1310 | if (NULL != pos->th) | 1310 | if (NULL != pos->th) |
1311 | { | 1311 | { |
@@ -1345,15 +1345,15 @@ static void | |||
1345 | shutdown_task (void *cls, | 1345 | shutdown_task (void *cls, |
1346 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1346 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1347 | { | 1347 | { |
1348 | if (GNUNET_SCHEDULER_NO_TASK != flood_task) | 1348 | if (NULL != flood_task) |
1349 | { | 1349 | { |
1350 | GNUNET_SCHEDULER_cancel (flood_task); | 1350 | GNUNET_SCHEDULER_cancel (flood_task); |
1351 | flood_task = GNUNET_SCHEDULER_NO_TASK; | 1351 | flood_task = NULL; |
1352 | } | 1352 | } |
1353 | if (GNUNET_SCHEDULER_NO_TASK != proof_task) | 1353 | if (NULL != proof_task) |
1354 | { | 1354 | { |
1355 | GNUNET_SCHEDULER_cancel (proof_task); | 1355 | GNUNET_SCHEDULER_cancel (proof_task); |
1356 | proof_task = GNUNET_SCHEDULER_NO_TASK; | 1356 | proof_task = NULL; |
1357 | write_proof (); /* remember progress */ | 1357 | write_proof (); /* remember progress */ |
1358 | } | 1358 | } |
1359 | if (NULL != nc) | 1359 | if (NULL != nc) |