summaryrefslogtreecommitdiff
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)
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,
size_t plaintext_len)
{
const struct GNUNET_MessageHeader *hdr = plaintext;
+ const char *pos = plaintext;
while (ntohs (hdr->size) < plaintext_len)
{
@@ -1090,19 +1091,25 @@ pass_plaintext_to_core (struct SenderAddress *sender,
"# bytes given to core",
ntohs (hdr->size),
GNUNET_NO);
- (void)
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Giving %u bytes to TNG\n", ntohs (hdr->size));
+ GNUNET_assert (GNUNET_SYSERR !=
GNUNET_TRANSPORT_communicator_receive (ch,
&sender->target,
hdr,
ADDRESS_VALIDITY_PERIOD,
NULL /* no flow control possible */
,
- NULL);
+ NULL));
/* move on to next message, if any */
plaintext_len -= ntohs (hdr->size);
if (plaintext_len < sizeof(*hdr))
break;
- hdr = plaintext + ntohs (hdr->size);
+ pos += ntohs (hdr->size);
+ hdr = (const struct GNUNET_MessageHeader *)pos;
+ //TODO for now..., we do not actually sen >1msg or have a way of telling
+ //if we are done
+ break;
}
GNUNET_STATISTICS_update (stats,
"# bytes padding discarded",