aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-communicator-udp.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-12-31 12:39:14 +0900
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-12-31 12:39:14 +0900
commit9aa5f80626ef47b1c5f027308abc5dcef0adbb89 (patch)
treed96d229f87dc11d73daf3b38bce1e740b874f031 /src/transport/gnunet-communicator-udp.c
parentb82fedab2505eccef3161d225473a5c75dd012cd (diff)
downloadgnunet-9aa5f80626ef47b1c5f027308abc5dcef0adbb89.tar.gz
gnunet-9aa5f80626ef47b1c5f027308abc5dcef0adbb89.zip
update udp communicator
Diffstat (limited to 'src/transport/gnunet-communicator-udp.c')
-rw-r--r--src/transport/gnunet-communicator-udp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c
index 6a4fea315..5abf42588 100644
--- a/src/transport/gnunet-communicator-udp.c
+++ b/src/transport/gnunet-communicator-udp.c
@@ -1083,6 +1083,7 @@ pass_plaintext_to_core (struct SenderAddress *sender,
1083 size_t plaintext_len) 1083 size_t plaintext_len)
1084{ 1084{
1085 const struct GNUNET_MessageHeader *hdr = plaintext; 1085 const struct GNUNET_MessageHeader *hdr = plaintext;
1086 const char *pos = plaintext;
1086 1087
1087 while (ntohs (hdr->size) < plaintext_len) 1088 while (ntohs (hdr->size) < plaintext_len)
1088 { 1089 {
@@ -1090,19 +1091,25 @@ pass_plaintext_to_core (struct SenderAddress *sender,
1090 "# bytes given to core", 1091 "# bytes given to core",
1091 ntohs (hdr->size), 1092 ntohs (hdr->size),
1092 GNUNET_NO); 1093 GNUNET_NO);
1093 (void) 1094 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1095 "Giving %u bytes to TNG\n", ntohs (hdr->size));
1096 GNUNET_assert (GNUNET_SYSERR !=
1094 GNUNET_TRANSPORT_communicator_receive (ch, 1097 GNUNET_TRANSPORT_communicator_receive (ch,
1095 &sender->target, 1098 &sender->target,
1096 hdr, 1099 hdr,
1097 ADDRESS_VALIDITY_PERIOD, 1100 ADDRESS_VALIDITY_PERIOD,
1098 NULL /* no flow control possible */ 1101 NULL /* no flow control possible */
1099 , 1102 ,
1100 NULL); 1103 NULL));
1101 /* move on to next message, if any */ 1104 /* move on to next message, if any */
1102 plaintext_len -= ntohs (hdr->size); 1105 plaintext_len -= ntohs (hdr->size);
1103 if (plaintext_len < sizeof(*hdr)) 1106 if (plaintext_len < sizeof(*hdr))
1104 break; 1107 break;
1105 hdr = plaintext + ntohs (hdr->size); 1108 pos += ntohs (hdr->size);
1109 hdr = (const struct GNUNET_MessageHeader *)pos;
1110 //TODO for now..., we do not actually sen >1msg or have a way of telling
1111 //if we are done
1112 break;
1106 } 1113 }
1107 GNUNET_STATISTICS_update (stats, 1114 GNUNET_STATISTICS_update (stats,
1108 "# bytes padding discarded", 1115 "# bytes padding discarded",