diff options
Diffstat (limited to 'src/cadet/gnunet-service-cadet_channel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet_channel.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index e6fce562f..dab53b8c4 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c | |||
@@ -385,29 +385,32 @@ struct CadetChannel | |||
385 | * Type of message to be droped. See GCT_send. | 385 | * Type of message to be droped. See GCT_send. |
386 | */ | 386 | */ |
387 | uint16_t type GNUNET_PACKED; | 387 | uint16_t type GNUNET_PACKED; |
388 | 388 | ||
389 | }; | 389 | }; |
390 | 390 | ||
391 | /** | 391 | /** |
392 | * Assign type of message to drop. | 392 | * Assign type of message to drop. |
393 | * @param ch CadetChannel to assign type to drop. | 393 | * @param ch CadetChannel to assign type to drop. |
394 | * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. | 394 | * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. |
395 | */ | 395 | */ |
396 | void | 396 | void |
397 | GCCH_assign_type_to_drop(struct CadetChannel *ch, const struct GNUNET_CADET_RequestDropCadetMessage *message) | 397 | GCCH_assign_type_to_drop (struct CadetChannel *ch, const struct |
398 | GNUNET_CADET_RequestDropCadetMessage *message) | ||
398 | { | 399 | { |
399 | 400 | ||
400 | ch->type = message->type; | 401 | ch->type = message->type; |
401 | 402 | ||
402 | } | 403 | } |
403 | 404 | ||
405 | |||
404 | /** | 406 | /** |
405 | * Check if type of message is the one to drop. | 407 | * Check if type of message is the one to drop. |
406 | * @param ch CadetChannel to check for message type to drop. | 408 | * @param ch CadetChannel to check for message type to drop. |
407 | * @param message GNUNET_MessageHeader to compare the type with. | 409 | * @param message GNUNET_MessageHeader to compare the type with. |
408 | */ | 410 | */ |
409 | int | 411 | int |
410 | GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader *message) | 412 | GCCH_is_type_to_drop (struct CadetChannel *ch, const struct |
413 | GNUNET_MessageHeader *message) | ||
411 | { | 414 | { |
412 | 415 | ||
413 | if (ch->type == message->type) | 416 | if (ch->type == message->type) |
@@ -419,6 +422,7 @@ GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader | |||
419 | return GNUNET_NO; | 422 | return GNUNET_NO; |
420 | } | 423 | } |
421 | 424 | ||
425 | |||
422 | /** | 426 | /** |
423 | * Get the static string for identification of the channel. | 427 | * Get the static string for identification of the channel. |
424 | * | 428 | * |
@@ -854,7 +858,8 @@ send_channel_data_ack (struct CadetChannel *ch) | |||
854 | GCCH_2s (ch)); | 858 | GCCH_2s (ch)); |
855 | if (NULL != ch->last_control_qe) | 859 | if (NULL != ch->last_control_qe) |
856 | GCT_send_cancel (ch->last_control_qe); | 860 | GCT_send_cancel (ch->last_control_qe); |
857 | ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); | 861 | ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, |
862 | &msg.ctn); | ||
858 | } | 863 | } |
859 | 864 | ||
860 | 865 | ||
@@ -881,7 +886,8 @@ send_open_ack (void *cls) | |||
881 | msg.port = ch->port; | 886 | msg.port = ch->port; |
882 | if (NULL != ch->last_control_qe) | 887 | if (NULL != ch->last_control_qe) |
883 | GCT_send_cancel (ch->last_control_qe); | 888 | GCT_send_cancel (ch->last_control_qe); |
884 | ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); | 889 | ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, |
890 | &msg.ctn); | ||
885 | } | 891 | } |
886 | 892 | ||
887 | 893 | ||
@@ -1513,7 +1519,8 @@ retry_transmission (void *cls) | |||
1513 | "Retrying transmission on %s of message %u\n", | 1519 | "Retrying transmission on %s of message %u\n", |
1514 | GCCH_2s (ch), | 1520 | GCCH_2s (ch), |
1515 | (unsigned int) ntohl (crm->data_message->mid.mid)); | 1521 | (unsigned int) ntohl (crm->data_message->mid.mid)); |
1516 | crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); | 1522 | crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, |
1523 | &crm->data_message->ctn); | ||
1517 | GNUNET_assert (NULL == ch->retry_data_task); | 1524 | GNUNET_assert (NULL == ch->retry_data_task); |
1518 | } | 1525 | } |
1519 | 1526 | ||
@@ -1901,7 +1908,8 @@ GCCH_handle_local_data (struct CadetChannel *ch, | |||
1901 | GNUNET_SCHEDULER_cancel (ch->retry_data_task); | 1908 | GNUNET_SCHEDULER_cancel (ch->retry_data_task); |
1902 | ch->retry_data_task = NULL; | 1909 | ch->retry_data_task = NULL; |
1903 | } | 1910 | } |
1904 | crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); | 1911 | crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, |
1912 | &crm->data_message->ctn); | ||
1905 | GNUNET_assert (NULL == ch->retry_data_task); | 1913 | GNUNET_assert (NULL == ch->retry_data_task); |
1906 | return GNUNET_OK; | 1914 | return GNUNET_OK; |
1907 | } | 1915 | } |