aboutsummaryrefslogtreecommitdiff
path: root/src/ats/gnunet-service-ats_scheduling.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-22 21:08:43 +0000
committerChristian Grothoff <christian@grothoff.org>2015-01-22 21:08:43 +0000
commit9c95f4ea09fa61fc193fc45873f76bf6fe6d93f3 (patch)
treec11ef2beef617c7f992fc447d3b017c9d8e667c6 /src/ats/gnunet-service-ats_scheduling.c
parent0c19c26a8a2d5b05ed8fc8abfca49cce2005c9ef (diff)
downloadgnunet-9c95f4ea09fa61fc193fc45873f76bf6fe6d93f3.tar.gz
gnunet-9c95f4ea09fa61fc193fc45873f76bf6fe6d93f3.zip
split structs for address adding and updating
Diffstat (limited to 'src/ats/gnunet-service-ats_scheduling.c')
-rw-r--r--src/ats/gnunet-service-ats_scheduling.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c
index 0d8b0fa25..b0a52f39c 100644
--- a/src/ats/gnunet-service-ats_scheduling.c
+++ b/src/ats/gnunet-service-ats_scheduling.c
@@ -241,7 +241,7 @@ GAS_handle_address_add (void *cls,
241 struct GNUNET_SERVER_Client *client, 241 struct GNUNET_SERVER_Client *client,
242 const struct GNUNET_MessageHeader *message) 242 const struct GNUNET_MessageHeader *message)
243{ 243{
244 const struct AddressUpdateMessage *m; 244 const struct AddressAddMessage *m;
245 const struct GNUNET_ATS_Information *atsi; 245 const struct GNUNET_ATS_Information *atsi;
246 const char *address; 246 const char *address;
247 const char *plugin_name; 247 const char *plugin_name;
@@ -254,13 +254,13 @@ GAS_handle_address_add (void *cls,
254 "Received `%s' message\n", 254 "Received `%s' message\n",
255 "ADDRESS_ADD"); 255 "ADDRESS_ADD");
256 size = ntohs (message->size); 256 size = ntohs (message->size);
257 if (size < sizeof (struct AddressUpdateMessage)) 257 if (size < sizeof (struct AddressAddMessage))
258 { 258 {
259 GNUNET_break (0); 259 GNUNET_break (0);
260 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 260 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
261 return; 261 return;
262 } 262 }
263 m = (const struct AddressUpdateMessage *) message; 263 m = (const struct AddressAddMessage *) message;
264 ats_count = ntohl (m->ats_count); 264 ats_count = ntohl (m->ats_count);
265 address_length = ntohs (m->address_length); 265 address_length = ntohs (m->address_length);
266 plugin_name_length = ntohs (m->plugin_name_length); 266 plugin_name_length = ntohs (m->plugin_name_length);
@@ -273,7 +273,7 @@ GAS_handle_address_add (void *cls,
273 273
274 if ((address_length + plugin_name_length + 274 if ((address_length + plugin_name_length +
275 ats_count * sizeof (struct GNUNET_ATS_Information) + 275 ats_count * sizeof (struct GNUNET_ATS_Information) +
276 sizeof (struct AddressUpdateMessage) != ntohs (message->size)) || 276 sizeof (struct AddressAddMessage) != ntohs (message->size)) ||
277 (ats_count > 277 (ats_count >
278 GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) || 278 GNUNET_SERVER_MAX_MESSAGE_SIZE / sizeof (struct GNUNET_ATS_Information)) ||
279 ((plugin_name_length > 0) && (plugin_name[plugin_name_length - 1] != '\0'))) 279 ((plugin_name_length > 0) && (plugin_name[plugin_name_length - 1] != '\0')))