aboutsummaryrefslogtreecommitdiff
path: root/src/dv/dv_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/dv/dv_api.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/dv/dv_api.c')
-rw-r--r--src/dv/dv_api.c49
1 files changed, 20 insertions, 29 deletions
diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c
index 7a250b5a6..3450e5844 100644
--- a/src/dv/dv_api.c
+++ b/src/dv/dv_api.c
@@ -282,15 +282,13 @@ process_pending_message (struct GNUNET_DV_Handle *handle)
282 handle->current->next = NULL; 282 handle->current->next = NULL;
283 283
284 if (NULL == 284 if (NULL ==
285 (handle->th = GNUNET_CLIENT_notify_transmit_ready (handle->client, 285 (handle->th =
286 ntohs 286 GNUNET_CLIENT_notify_transmit_ready (handle->client,
287 (handle->current-> 287 ntohs (handle->current->msg->header.
288 msg->header.size), 288 size),
289 handle->current-> 289 handle->current->msg->timeout,
290 msg->timeout, 290 GNUNET_YES, &transmit_pending,
291 GNUNET_YES, 291 handle)))
292 &transmit_pending,
293 handle)))
294 { 292 {
295#if DEBUG_DV 293#if DEBUG_DV
296 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -397,12 +395,10 @@ handle_message_receipt (void *cls, const struct GNUNET_MessageHeader *msg)
397 ntohl (received_msg->distance)); 395 ntohl (received_msg->distance));
398#endif 396#endif
399 397
400 handle->receive_handler (handle->receive_cls, 398 handle->receive_handler (handle->receive_cls, &received_msg->sender,
401 &received_msg->sender, 399 packed_msg, packed_msg_len,
402 packed_msg, 400 ntohl (received_msg->distance), sender_address,
403 packed_msg_len, 401 sender_address_len);
404 ntohl (received_msg->distance),
405 sender_address, sender_address_len);
406 402
407 GNUNET_free (sender_address); 403 GNUNET_free (sender_address);
408 break; 404 break;
@@ -431,9 +427,8 @@ handle_message_receipt (void *cls, const struct GNUNET_MessageHeader *msg)
431 default: 427 default:
432 break; 428 break;
433 } 429 }
434 GNUNET_CLIENT_receive (handle->client, 430 GNUNET_CLIENT_receive (handle->client, &handle_message_receipt, handle,
435 &handle_message_receipt, 431 GNUNET_TIME_UNIT_FOREVER_REL);
436 handle, GNUNET_TIME_UNIT_FOREVER_REL);
437} 432}
438 433
439/** 434/**
@@ -454,14 +449,11 @@ handle_message_receipt (void *cls, const struct GNUNET_MessageHeader *msg)
454 */ 449 */
455int 450int
456GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, 451GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle,
457 const struct GNUNET_PeerIdentity *target, 452 const struct GNUNET_PeerIdentity *target, const char *msgbuf,
458 const char *msgbuf, 453 size_t msgbuf_size, unsigned int priority,
459 size_t msgbuf_size, 454 struct GNUNET_TIME_Relative timeout, const void *addr,
460 unsigned int priority, 455 size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont,
461 struct GNUNET_TIME_Relative timeout, 456 void *cont_cls)
462 const void *addr,
463 size_t addrlen,
464 GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls)
465{ 457{
466 struct GNUNET_DV_SendMessage *msg; 458 struct GNUNET_DV_SendMessage *msg;
467 struct SendCallbackContext *send_ctx; 459 struct SendCallbackContext *send_ctx;
@@ -537,9 +529,8 @@ transmit_start (void *cls, size_t size, void *buf)
537 memcpy (buf, start_context->message, tsize); 529 memcpy (buf, start_context->message, tsize);
538 GNUNET_free (start_context->message); 530 GNUNET_free (start_context->message);
539 GNUNET_free (start_context); 531 GNUNET_free (start_context);
540 GNUNET_CLIENT_receive (handle->client, 532 GNUNET_CLIENT_receive (handle->client, &handle_message_receipt, handle,
541 &handle_message_receipt, 533 GNUNET_TIME_UNIT_FOREVER_REL);
542 handle, GNUNET_TIME_UNIT_FOREVER_REL);
543 534
544 535
545 return tsize; 536 return tsize;