diff options
Diffstat (limited to 'src/psyc/psyc_api.c')
-rw-r--r-- | src/psyc/psyc_api.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/psyc/psyc_api.c b/src/psyc/psyc_api.c index b862eee9c..6128e4d82 100644 --- a/src/psyc/psyc_api.c +++ b/src/psyc/psyc_api.c | |||
@@ -669,7 +669,7 @@ GNUNET_PSYC_master_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
669 | req->channel_key = *channel_key; | 669 | req->channel_key = *channel_key; |
670 | req->policy = policy; | 670 | req->policy = policy; |
671 | 671 | ||
672 | chn->connect_msg = (struct GNUNET_MessageHeader *) req; | 672 | chn->connect_msg = &req->header; |
673 | chn->cfg = cfg; | 673 | chn->cfg = cfg; |
674 | chn->is_master = GNUNET_YES; | 674 | chn->is_master = GNUNET_YES; |
675 | 675 | ||
@@ -896,8 +896,7 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
896 | else | 896 | else |
897 | join_msg_size = ntohs (join_msg->header.size); | 897 | join_msg_size = ntohs (join_msg->header.size); |
898 | req = GNUNET_malloc (sizeof (*req) + relay_size + join_msg_size); | 898 | req = GNUNET_malloc (sizeof (*req) + relay_size + join_msg_size); |
899 | req->header.size = htons (sizeof (*req) | 899 | req->header.size = htons (sizeof (*req) + relay_size + join_msg_size); |
900 | + relay_count * sizeof (*relays)); | ||
901 | req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN); | 900 | req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYC_SLAVE_JOIN); |
902 | req->channel_key = *channel_key; | 901 | req->channel_key = *channel_key; |
903 | req->slave_key = *slave_key; | 902 | req->slave_key = *slave_key; |
@@ -908,11 +907,9 @@ GNUNET_PSYC_slave_join (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
908 | memcpy (&req[1], relays, relay_size); | 907 | memcpy (&req[1], relays, relay_size); |
909 | 908 | ||
910 | if (NULL != join_msg) | 909 | if (NULL != join_msg) |
911 | memcpy ((char *) &req[1] + relay_size, | 910 | memcpy ((char *) &req[1] + relay_size, join_msg, join_msg_size); |
912 | join_msg, | ||
913 | join_msg_size); | ||
914 | 911 | ||
915 | chn->connect_msg = (struct GNUNET_MessageHeader *) req; | 912 | chn->connect_msg = &req->header; |
916 | chn->cfg = cfg; | 913 | chn->cfg = cfg; |
917 | chn->is_master = GNUNET_NO; | 914 | chn->is_master = GNUNET_NO; |
918 | 915 | ||