diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-23 23:50:55 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-23 23:50:55 +0100 |
commit | 3bdda27bbeb0b69bd2c5a73022b237ae0342e9c1 (patch) | |
tree | 7143b55e986ddb9e0dbb748fd65ec84a48a422b9 /src/cadet/gnunet-service-cadet-new_channel.c | |
parent | 6788466367dd7c22024fe07a8a61cbedff1286ae (diff) | |
download | gnunet-3bdda27bbeb0b69bd2c5a73022b237ae0342e9c1.tar.gz gnunet-3bdda27bbeb0b69bd2c5a73022b237ae0342e9c1.zip |
better logging, prep for having LOCAL_ACKs
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new_channel.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new_channel.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/cadet/gnunet-service-cadet-new_channel.c b/src/cadet/gnunet-service-cadet-new_channel.c index ec594066b..74aafe5a1 100644 --- a/src/cadet/gnunet-service-cadet-new_channel.c +++ b/src/cadet/gnunet-service-cadet-new_channel.c | |||
@@ -1020,10 +1020,6 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch, | |||
1020 | 1020 | ||
1021 | GNUNET_assert (GNUNET_NO == ch->is_loopback); | 1021 | GNUNET_assert (GNUNET_NO == ch->is_loopback); |
1022 | payload_size = ntohs (msg->header.size) - sizeof (*msg); | 1022 | payload_size = ntohs (msg->header.size) - sizeof (*msg); |
1023 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1024 | "Receicved %u bytes of application data on %s\n", | ||
1025 | (unsigned int) payload_size, | ||
1026 | GCCH_2s (ch)); | ||
1027 | env = GNUNET_MQ_msg_extra (ld, | 1023 | env = GNUNET_MQ_msg_extra (ld, |
1028 | payload_size, | 1024 | payload_size, |
1029 | GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA); | 1025 | GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA); |
@@ -1035,6 +1031,11 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch, | |||
1035 | ( (GNUNET_YES == ch->out_of_order) || | 1031 | ( (GNUNET_YES == ch->out_of_order) || |
1036 | (msg->mid.mid == ch->mid_recv.mid) ) ) | 1032 | (msg->mid.mid == ch->mid_recv.mid) ) ) |
1037 | { | 1033 | { |
1034 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1035 | "Giving %u bytes of payload from %s to client %s\n", | ||
1036 | (unsigned int) payload_size, | ||
1037 | GCCH_2s (ch), | ||
1038 | GSC_2s (ch->owner ? ch->owner : ch->dest)); | ||
1038 | GSC_send_to_client (ch->owner ? ch->owner : ch->dest, | 1039 | GSC_send_to_client (ch->owner ? ch->owner : ch->dest, |
1039 | env); | 1040 | env); |
1040 | ch->mid_recv.mid = htonl (1 + ntohl (ch->mid_recv.mid)); | 1041 | ch->mid_recv.mid = htonl (1 + ntohl (ch->mid_recv.mid)); |
@@ -1044,6 +1045,16 @@ GCCH_handle_channel_plaintext_data (struct CadetChannel *ch, | |||
1044 | { | 1045 | { |
1045 | /* FIXME-SECURITY: if the element is WAY too far ahead, | 1046 | /* FIXME-SECURITY: if the element is WAY too far ahead, |
1046 | drop it (can't buffer too much!) */ | 1047 | drop it (can't buffer too much!) */ |
1048 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1049 | "Queuing %s payload of %u bytes on %s (mid %u, need %u first)\n", | ||
1050 | (GNUNET_YES == ch->client_ready) | ||
1051 | ? "out-of-order" | ||
1052 | : "client-not-ready", | ||
1053 | (unsigned int) payload_size, | ||
1054 | GCCH_2s (ch), | ||
1055 | ntohl (msg->mid.mid), | ||
1056 | ntohl (ch->mid_recv.mid)); | ||
1057 | |||
1047 | com = GNUNET_new (struct CadetOutOfOrderMessage); | 1058 | com = GNUNET_new (struct CadetOutOfOrderMessage); |
1048 | com->mid = msg->mid; | 1059 | com->mid = msg->mid; |
1049 | com->env = env; | 1060 | com->env = env; |
@@ -1438,11 +1449,15 @@ send_client_buffered_data (struct CadetChannel *ch) | |||
1438 | * Handle ACK from client on local channel. | 1449 | * Handle ACK from client on local channel. |
1439 | * | 1450 | * |
1440 | * @param ch channel to destroy | 1451 | * @param ch channel to destroy |
1452 | * @param client_ccn ccn of the client sending the ack | ||
1441 | */ | 1453 | */ |
1442 | void | 1454 | void |
1443 | GCCH_handle_local_ack (struct CadetChannel *ch) | 1455 | GCCH_handle_local_ack (struct CadetChannel *ch, |
1456 | struct GNUNET_CADET_ClientChannelNumber client_ccn) | ||
1444 | { | 1457 | { |
1445 | ch->client_ready = GNUNET_YES; | 1458 | ch->client_ready = GNUNET_YES; |
1459 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1460 | "Got LOCAL_ACK, client ready to receive more data!\n"); | ||
1446 | send_client_buffered_data (ch); | 1461 | send_client_buffered_data (ch); |
1447 | } | 1462 | } |
1448 | 1463 | ||