diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-01-01 13:35:28 +0900 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-01-01 13:35:28 +0900 |
commit | 0c5090e7d76fd7c85b92f0c4f918cf5420bd68f8 (patch) | |
tree | 1c2d5d10f4a3d288c42198b7989cd70ac9537f05 /src/transport/gnunet-communicator-udp.c | |
parent | 65b645e3c3910401d43d922d46096aa22c6de9e7 (diff) | |
download | gnunet-0c5090e7d76fd7c85b92f0c4f918cf5420bd68f8.tar.gz gnunet-0c5090e7d76fd7c85b92f0c4f918cf5420bd68f8.zip |
fix backchannel
Diffstat (limited to 'src/transport/gnunet-communicator-udp.c')
-rw-r--r-- | src/transport/gnunet-communicator-udp.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c index 5abf42588..e931bd2e7 100644 --- a/src/transport/gnunet-communicator-udp.c +++ b/src/transport/gnunet-communicator-udp.c | |||
@@ -1094,21 +1094,21 @@ pass_plaintext_to_core (struct SenderAddress *sender, | |||
1094 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1094 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1095 | "Giving %u bytes to TNG\n", ntohs (hdr->size)); | 1095 | "Giving %u bytes to TNG\n", ntohs (hdr->size)); |
1096 | GNUNET_assert (GNUNET_SYSERR != | 1096 | GNUNET_assert (GNUNET_SYSERR != |
1097 | GNUNET_TRANSPORT_communicator_receive (ch, | 1097 | GNUNET_TRANSPORT_communicator_receive (ch, |
1098 | &sender->target, | 1098 | &sender->target, |
1099 | hdr, | 1099 | hdr, |
1100 | ADDRESS_VALIDITY_PERIOD, | 1100 | ADDRESS_VALIDITY_PERIOD, |
1101 | NULL /* no flow control possible */ | 1101 | NULL /* no flow control possible */ |
1102 | , | 1102 | , |
1103 | NULL)); | 1103 | NULL)); |
1104 | /* move on to next message, if any */ | 1104 | /* move on to next message, if any */ |
1105 | plaintext_len -= ntohs (hdr->size); | 1105 | plaintext_len -= ntohs (hdr->size); |
1106 | if (plaintext_len < sizeof(*hdr)) | 1106 | if (plaintext_len < sizeof(*hdr)) |
1107 | break; | 1107 | break; |
1108 | pos += ntohs (hdr->size); | 1108 | pos += ntohs (hdr->size); |
1109 | hdr = (const struct GNUNET_MessageHeader *)pos; | 1109 | hdr = (const struct GNUNET_MessageHeader *) pos; |
1110 | //TODO for now..., we do not actually sen >1msg or have a way of telling | 1110 | // TODO for now..., we do not actually sen >1msg or have a way of telling |
1111 | //if we are done | 1111 | // if we are done |
1112 | break; | 1112 | break; |
1113 | } | 1113 | } |
1114 | GNUNET_STATISTICS_update (stats, | 1114 | GNUNET_STATISTICS_update (stats, |
@@ -1958,7 +1958,8 @@ mq_send (struct GNUNET_MQ_Handle *mq, | |||
1958 | receiver->address_len)) | 1958 | receiver->address_len)) |
1959 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); | 1959 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); |
1960 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1960 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1961 | "Sending KX to %s\n", GNUNET_a2s (receiver->address, receiver->address_len)); | 1961 | "Sending KX to %s\n", GNUNET_a2s (receiver->address, |
1962 | receiver->address_len)); | ||
1962 | GNUNET_MQ_impl_send_continue (mq); | 1963 | GNUNET_MQ_impl_send_continue (mq); |
1963 | return; | 1964 | return; |
1964 | } /* End of KX encryption method */ | 1965 | } /* End of KX encryption method */ |
@@ -1966,6 +1967,8 @@ mq_send (struct GNUNET_MQ_Handle *mq, | |||
1966 | /* begin "BOX" encryption method, scan for ACKs from tail! */ | 1967 | /* begin "BOX" encryption method, scan for ACKs from tail! */ |
1967 | for (struct SharedSecret *ss = receiver->ss_tail; NULL != ss; ss = ss->prev) | 1968 | for (struct SharedSecret *ss = receiver->ss_tail; NULL != ss; ss = ss->prev) |
1968 | { | 1969 | { |
1970 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1971 | "In non-kx mode...\n"); | ||
1969 | if (ss->sequence_used < ss->sequence_allowed) | 1972 | if (ss->sequence_used < ss->sequence_allowed) |
1970 | { | 1973 | { |
1971 | char dgram[sizeof(struct UDPBox) + receiver->mtu]; | 1974 | char dgram[sizeof(struct UDPBox) + receiver->mtu]; |
@@ -1994,7 +1997,7 @@ mq_send (struct GNUNET_MQ_Handle *mq, | |||
1994 | receiver->address_len)) | 1997 | receiver->address_len)) |
1995 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); | 1998 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "send"); |
1996 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1999 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1997 | "Sending data\n"); | 2000 | "Sending data\n"); |
1998 | 2001 | ||
1999 | GNUNET_MQ_impl_send_continue (mq); | 2002 | GNUNET_MQ_impl_send_continue (mq); |
2000 | receiver->acks_available--; | 2003 | receiver->acks_available--; |