aboutsummaryrefslogtreecommitdiff
path: root/src/dv/dv_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dv/dv_api.c')
-rw-r--r--src/dv/dv_api.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c
index 1bbb789f9..412ab47ad 100644
--- a/src/dv/dv_api.c
+++ b/src/dv/dv_api.c
@@ -63,7 +63,7 @@ struct GNUNET_DV_TransmitHandle
63 * Closure for 'cb'. 63 * Closure for 'cb'.
64 */ 64 */
65 void *cb_cls; 65 void *cb_cls;
66 66
67 /** 67 /**
68 * The actual message (allocated at the end of this struct). 68 * The actual message (allocated at the end of this struct).
69 */ 69 */
@@ -78,7 +78,7 @@ struct GNUNET_DV_TransmitHandle
78 * UID of our message, if any. 78 * UID of our message, if any.
79 */ 79 */
80 uint32_t uid; 80 uint32_t uid;
81 81
82}; 82};
83 83
84 84
@@ -107,7 +107,7 @@ struct GNUNET_DV_ServiceHandle
107 * Closure for the callbacks. 107 * Closure for the callbacks.
108 */ 108 */
109 void *cls; 109 void *cls;
110 110
111 /** 111 /**
112 * Function to call on connect events. 112 * Function to call on connect events.
113 */ 113 */
@@ -221,12 +221,12 @@ start_transmit (struct GNUNET_DV_ServiceHandle *sh)
221 if (NULL != sh->th) 221 if (NULL != sh->th)
222 return; 222 return;
223 if (NULL == sh->th_head) 223 if (NULL == sh->th_head)
224 return; 224 return;
225 sh->th = 225 sh->th =
226 GNUNET_CLIENT_notify_transmit_ready (sh->client, 226 GNUNET_CLIENT_notify_transmit_ready (sh->client,
227 ntohs (sh->th_head->msg->size), 227 ntohs (sh->th_head->msg->size),
228 GNUNET_TIME_UNIT_FOREVER_REL, 228 GNUNET_TIME_UNIT_FOREVER_REL,
229 GNUNET_NO, 229 GNUNET_NO,
230 &transmit_pending, sh); 230 &transmit_pending, sh);
231} 231}
232 232
@@ -291,7 +291,7 @@ process_ack (void *cls,
291 * @param msg the message that was received 291 * @param msg the message that was received
292 */ 292 */
293static void 293static void
294handle_message_receipt (void *cls, 294handle_message_receipt (void *cls,
295 const struct GNUNET_MessageHeader *msg) 295 const struct GNUNET_MessageHeader *msg)
296{ 296{
297 struct GNUNET_DV_ServiceHandle *sh = cls; 297 struct GNUNET_DV_ServiceHandle *sh = cls;
@@ -302,7 +302,7 @@ handle_message_receipt (void *cls,
302 const struct GNUNET_MessageHeader *payload; 302 const struct GNUNET_MessageHeader *payload;
303 const struct GNUNET_DV_AckMessage *ack; 303 const struct GNUNET_DV_AckMessage *ack;
304 struct AckContext ctx; 304 struct AckContext ctx;
305 305
306 if (NULL == msg) 306 if (NULL == msg)
307 { 307 {
308 /* Connection closed */ 308 /* Connection closed */
@@ -389,7 +389,7 @@ handle_message_receipt (void *cls,
389 reconnect (sh); 389 reconnect (sh);
390 break; 390 break;
391 } 391 }
392 GNUNET_CLIENT_receive (sh->client, 392 GNUNET_CLIENT_receive (sh->client,
393 &handle_message_receipt, sh, 393 &handle_message_receipt, sh,
394 GNUNET_TIME_UNIT_FOREVER_REL); 394 GNUNET_TIME_UNIT_FOREVER_REL);
395} 395}
@@ -402,7 +402,7 @@ handle_message_receipt (void *cls,
402 * @param size number of bytes available in buf 402 * @param size number of bytes available in buf
403 * @param buf where to copy the message 403 * @param buf where to copy the message
404 * @return number of bytes written to buf 404 * @return number of bytes written to buf
405 */ 405 */
406static size_t 406static size_t
407transmit_start (void *cls, 407transmit_start (void *cls,
408 size_t size, 408 size_t size,
@@ -464,7 +464,7 @@ cleanup_send_cb (void *cls,
464 */ 464 */
465static void 465static void
466reconnect (struct GNUNET_DV_ServiceHandle *sh) 466reconnect (struct GNUNET_DV_ServiceHandle *sh)
467{ 467{
468 if (NULL != sh->th) 468 if (NULL != sh->th)
469 { 469 {
470 GNUNET_CLIENT_notify_transmit_ready_cancel (sh->th); 470 GNUNET_CLIENT_notify_transmit_ready_cancel (sh->th);
@@ -538,7 +538,7 @@ void
538GNUNET_DV_service_disconnect (struct GNUNET_DV_ServiceHandle *sh) 538GNUNET_DV_service_disconnect (struct GNUNET_DV_ServiceHandle *sh)
539{ 539{
540 struct GNUNET_DV_TransmitHandle *pos; 540 struct GNUNET_DV_TransmitHandle *pos;
541 541
542 if (NULL == sh) 542 if (NULL == sh)
543 return; 543 return;
544 if (NULL != sh->th) 544 if (NULL != sh->th)
@@ -553,7 +553,7 @@ GNUNET_DV_service_disconnect (struct GNUNET_DV_ServiceHandle *sh)
553 pos); 553 pos);
554 GNUNET_free (pos); 554 GNUNET_free (pos);
555 } 555 }
556 if (NULL != sh->client) 556 if (NULL != sh->client)
557 { 557 {
558 GNUNET_CLIENT_disconnect (sh->client); 558 GNUNET_CLIENT_disconnect (sh->client);
559 sh->client = NULL; 559 sh->client = NULL;
@@ -607,7 +607,7 @@ GNUNET_DV_send (struct GNUNET_DV_ServiceHandle *sh,
607 th->msg = (const struct GNUNET_MessageHeader *) &th[1]; 607 th->msg = (const struct GNUNET_MessageHeader *) &th[1];
608 sm = (struct GNUNET_DV_SendMessage *) &th[1]; 608 sm = (struct GNUNET_DV_SendMessage *) &th[1];
609 sm->header.type = htons (GNUNET_MESSAGE_TYPE_DV_SEND); 609 sm->header.type = htons (GNUNET_MESSAGE_TYPE_DV_SEND);
610 sm->header.size = htons (sizeof (struct GNUNET_DV_SendMessage) + 610 sm->header.size = htons (sizeof (struct GNUNET_DV_SendMessage) +
611 ntohs (msg->size)); 611 ntohs (msg->size));
612 if (0 == sh->uid_gen) 612 if (0 == sh->uid_gen)
613 sh->uid_gen = 1; 613 sh->uid_gen = 1;