aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-03 15:00:26 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-03 15:00:26 +0000
commit7ae7229d2de6a6ef842634265847a46ac46f8c5c (patch)
treea06bd988dccc8fc26addac2a4b3d3133c5c71b25 /src/transport/transport_api.c
parent26ec3709bd1283f8cbb70e33043f69326285eb1e (diff)
downloadgnunet-7ae7229d2de6a6ef842634265847a46ac46f8c5c.tar.gz
gnunet-7ae7229d2de6a6ef842634265847a46ac46f8c5c.zip
fix 1821: only send payload to transport clients that care
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r--src/transport/transport_api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 2ececc10d..cff967b19 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -861,6 +861,7 @@ send_start (void *cls, size_t size, void *buf)
861{ 861{
862 struct GNUNET_TRANSPORT_Handle *h = cls; 862 struct GNUNET_TRANSPORT_Handle *h = cls;
863 struct StartMessage s; 863 struct StartMessage s;
864 uint32_t options;
864 865
865 if (buf == NULL) 866 if (buf == NULL)
866 { 867 {
@@ -877,7 +878,12 @@ send_start (void *cls, size_t size, void *buf)
877 GNUNET_assert (size >= sizeof (struct StartMessage)); 878 GNUNET_assert (size >= sizeof (struct StartMessage));
878 s.header.size = htons (sizeof (struct StartMessage)); 879 s.header.size = htons (sizeof (struct StartMessage));
879 s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START); 880 s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START);
880 s.do_check = htonl (h->check_self); 881 options = 0;
882 if (h->check_self)
883 options |= 1;
884 if (h->rec != NULL)
885 options |= 2;
886 s.options = htonl (options);
881 s.self = h->self; 887 s.self = h->self;
882 memcpy (buf, &s, sizeof (struct StartMessage)); 888 memcpy (buf, &s, sizeof (struct StartMessage));
883 GNUNET_CLIENT_receive (h->client, &demultiplexer, h, 889 GNUNET_CLIENT_receive (h->client, &demultiplexer, h,