aboutsummaryrefslogtreecommitdiff
path: root/src/util/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/client.c')
-rw-r--r--src/util/client.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/util/client.c b/src/util/client.c
index c222a0ff7..7128a2de4 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -70,7 +70,7 @@ struct GNUNET_CLIENT_TransmitHandle
70 * If we are re-trying and are delaying to do so, 70 * If we are re-trying and are delaying to do so,
71 * handle to the scheduled task managing the delay. 71 * handle to the scheduled task managing the delay.
72 */ 72 */
73 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 73 struct GNUNET_SCHEDULER_Task * reconnect_task;
74 74
75 /** 75 /**
76 * Timeout for the operation overall. 76 * Timeout for the operation overall.
@@ -182,7 +182,7 @@ struct GNUNET_CLIENT_Connection
182 * If we are re-trying and are delaying to do so, 182 * If we are re-trying and are delaying to do so,
183 * handle to the scheduled task managing the delay. 183 * handle to the scheduled task managing the delay.
184 */ 184 */
185 GNUNET_SCHEDULER_TaskIdentifier receive_task; 185 struct GNUNET_SCHEDULER_Task * receive_task;
186 186
187 /** 187 /**
188 * Buffer for received message. 188 * Buffer for received message.
@@ -457,10 +457,10 @@ GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *client)
457 GNUNET_CONNECTION_destroy (client->connection); 457 GNUNET_CONNECTION_destroy (client->connection);
458 client->connection = NULL; 458 client->connection = NULL;
459 } 459 }
460 if (GNUNET_SCHEDULER_NO_TASK != client->receive_task) 460 if (NULL != client->receive_task)
461 { 461 {
462 GNUNET_SCHEDULER_cancel (client->receive_task); 462 GNUNET_SCHEDULER_cancel (client->receive_task);
463 client->receive_task = GNUNET_SCHEDULER_NO_TASK; 463 client->receive_task = NULL;
464 } 464 }
465 if (NULL != client->tag) 465 if (NULL != client->tag)
466 { 466 {
@@ -581,7 +581,7 @@ receive_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
581 ntohs (cmsg->type), 581 ntohs (cmsg->type),
582 msize, 582 msize,
583 client->service_name); 583 client->service_name);
584 client->receive_task = GNUNET_SCHEDULER_NO_TASK; 584 client->receive_task = NULL;
585 GNUNET_assert (GNUNET_YES == client->msg_complete); 585 GNUNET_assert (GNUNET_YES == client->msg_complete);
586 GNUNET_assert (client->received_pos >= msize); 586 GNUNET_assert (client->received_pos >= msize);
587 memcpy (msg, cmsg, msize); 587 memcpy (msg, cmsg, msize);
@@ -623,7 +623,7 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *client,
623 client->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout); 623 client->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout);
624 if (GNUNET_YES == client->msg_complete) 624 if (GNUNET_YES == client->msg_complete)
625 { 625 {
626 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == client->receive_task); 626 GNUNET_assert (NULL == client->receive_task);
627 client->receive_task = GNUNET_SCHEDULER_add_now (&receive_task, client); 627 client->receive_task = GNUNET_SCHEDULER_add_now (&receive_task, client);
628 } 628 }
629 else 629 else
@@ -670,7 +670,7 @@ struct GNUNET_CLIENT_TestHandle
670 /** 670 /**
671 * ID of task used for asynchronous operations. 671 * ID of task used for asynchronous operations.
672 */ 672 */
673 GNUNET_SCHEDULER_TaskIdentifier task; 673 struct GNUNET_SCHEDULER_Task * task;
674 674
675 /** 675 /**
676 * Final result to report back (once known). 676 * Final result to report back (once known).
@@ -697,10 +697,10 @@ GNUNET_CLIENT_service_test_cancel (struct GNUNET_CLIENT_TestHandle *th)
697 GNUNET_CLIENT_disconnect (th->client); 697 GNUNET_CLIENT_disconnect (th->client);
698 th->client = NULL; 698 th->client = NULL;
699 } 699 }
700 if (GNUNET_SCHEDULER_NO_TASK != th->task) 700 if (NULL != th->task)
701 { 701 {
702 GNUNET_SCHEDULER_cancel (th->task); 702 GNUNET_SCHEDULER_cancel (th->task);
703 th->task = GNUNET_SCHEDULER_NO_TASK; 703 th->task = NULL;
704 } 704 }
705 GNUNET_free (th); 705 GNUNET_free (th);
706} 706}
@@ -719,7 +719,7 @@ report_result (void *cls,
719{ 719{
720 struct GNUNET_CLIENT_TestHandle *th = cls; 720 struct GNUNET_CLIENT_TestHandle *th = cls;
721 721
722 th->task = GNUNET_SCHEDULER_NO_TASK; 722 th->task = NULL;
723 th->cb (th->cb_cls, th->result); 723 th->cb (th->cb_cls, th->result);
724 GNUNET_CLIENT_service_test_cancel (th); 724 GNUNET_CLIENT_service_test_cancel (th);
725} 725}
@@ -1053,7 +1053,7 @@ client_delayed_retry (void *cls,
1053 struct GNUNET_CLIENT_TransmitHandle *th = cls; 1053 struct GNUNET_CLIENT_TransmitHandle *th = cls;
1054 struct GNUNET_TIME_Relative delay; 1054 struct GNUNET_TIME_Relative delay;
1055 1055
1056 th->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1056 th->reconnect_task = NULL;
1057 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1057 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1058 { 1058 {
1059 /* give up, was shutdown */ 1059 /* give up, was shutdown */
@@ -1077,7 +1077,7 @@ client_delayed_retry (void *cls,
1077 "Transmission failed %u times, trying again in %s.\n", 1077 "Transmission failed %u times, trying again in %s.\n",
1078 MAX_ATTEMPTS - th->attempts_left, 1078 MAX_ATTEMPTS - th->attempts_left,
1079 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); 1079 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
1080 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->reconnect_task); 1080 GNUNET_assert (NULL == th->reconnect_task);
1081 th->reconnect_task = 1081 th->reconnect_task =
1082 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th); 1082 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
1083 return; 1083 return;
@@ -1155,7 +1155,7 @@ client_notify (void *cls, size_t size, void *buf)
1155 MAX_ATTEMPTS - th->attempts_left, 1155 MAX_ATTEMPTS - th->attempts_left,
1156 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); 1156 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
1157 client->th = th; 1157 client->th = th;
1158 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->reconnect_task); 1158 GNUNET_assert (NULL == th->reconnect_task);
1159 th->reconnect_task = 1159 th->reconnect_task =
1160 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th); 1160 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
1161 return 0; 1161 return 0;
@@ -1224,7 +1224,7 @@ GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *client,
1224 client->th = th; 1224 client->th = th;
1225 if (NULL == client->connection) 1225 if (NULL == client->connection)
1226 { 1226 {
1227 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->reconnect_task); 1227 GNUNET_assert (NULL == th->reconnect_task);
1228 th->reconnect_task = 1228 th->reconnect_task =
1229 GNUNET_SCHEDULER_add_delayed (client->back_off, 1229 GNUNET_SCHEDULER_add_delayed (client->back_off,
1230 &client_delayed_retry, 1230 &client_delayed_retry,
@@ -1256,11 +1256,11 @@ GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *client,
1256void 1256void
1257GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle *th) 1257GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle *th)
1258{ 1258{
1259 if (GNUNET_SCHEDULER_NO_TASK != th->reconnect_task) 1259 if (NULL != th->reconnect_task)
1260 { 1260 {
1261 GNUNET_assert (NULL == th->th); 1261 GNUNET_assert (NULL == th->th);
1262 GNUNET_SCHEDULER_cancel (th->reconnect_task); 1262 GNUNET_SCHEDULER_cancel (th->reconnect_task);
1263 th->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1263 th->reconnect_task = NULL;
1264 } 1264 }
1265 else 1265 else
1266 { 1266 {