aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api_scheduling.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-18 18:49:13 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-18 18:49:13 +0000
commit710e8923105dfcc38d8aefed19e6da670db9c440 (patch)
treec6e46d41beedcf3ac2b13a1e040a790db8aa794a /src/ats/ats_api_scheduling.c
parent5dfc382a9f8467cd15b6a0c3a6e022fca9fc4a30 (diff)
downloadgnunet-710e8923105dfcc38d8aefed19e6da670db9c440.tar.gz
gnunet-710e8923105dfcc38d8aefed19e6da670db9c440.zip
partial refactoring, will cause FTBFS, to be completed ASAP
Diffstat (limited to 'src/ats/ats_api_scheduling.c')
-rw-r--r--src/ats/ats_api_scheduling.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index 0d0d102db..bc730b248 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -357,16 +357,14 @@ release_session (struct GNUNET_ATS_SchedulingHandle *sh,
357 * message from the service. 357 * message from the service.
358 * 358 *
359 * @param cls the `struct GNUNET_ATS_SchedulingHandle` 359 * @param cls the `struct GNUNET_ATS_SchedulingHandle`
360 * @param msg message received, NULL on timeout or fatal error 360 * @param srm message received
361 */ 361 */
362static void 362static void
363process_ats_session_release_message (void *cls, 363handle_ats_session_release (void *cls,
364 const struct GNUNET_MessageHeader *msg) 364 const struct GNUNET_ATS_SessionReleaseMessage *srm)
365{ 365{
366 struct GNUNET_ATS_SchedulingHandle *sh = cls; 366 struct GNUNET_ATS_SchedulingHandle *sh = cls;
367 const struct GNUNET_ATS_SessionReleaseMessage *srm;
368 367
369 srm = (const struct GNUNET_ATS_SessionReleaseMessage *) msg;
370 /* Note: peer field in srm not necessary right now, 368 /* Note: peer field in srm not necessary right now,
371 but might be good to have in the future */ 369 but might be good to have in the future */
372 release_session (sh, 370 release_session (sh,
@@ -379,18 +377,16 @@ process_ats_session_release_message (void *cls,
379 * message from the service. 377 * message from the service.
380 * 378 *
381 * @param cls the `struct GNUNET_ATS_SchedulingHandle` 379 * @param cls the `struct GNUNET_ATS_SchedulingHandle`
382 * @param msg message received, NULL on timeout or fatal error 380 * @param m message received
383 */ 381 */
384static void 382static void
385process_ats_address_suggestion_message (void *cls, 383handle_ats_address_suggestion (void *cls,
386 const struct GNUNET_MessageHeader *msg) 384 const struct AddressSuggestionMessage *m)
387{ 385{
388 struct GNUNET_ATS_SchedulingHandle *sh = cls; 386 struct GNUNET_ATS_SchedulingHandle *sh = cls;
389 const struct AddressSuggestionMessage *m;
390 struct GNUNET_ATS_AddressRecord *ar; 387 struct GNUNET_ATS_AddressRecord *ar;
391 uint32_t session_id; 388 uint32_t session_id;
392 389
393 m = (const struct AddressSuggestionMessage *) msg;
394 session_id = ntohl (m->session_id); 390 session_id = ntohl (m->session_id);
395 if (0 == session_id) 391 if (0 == session_id)
396 { 392 {
@@ -528,14 +524,17 @@ send_add_address_message (struct GNUNET_ATS_SchedulingHandle *sh,
528static void 524static void
529reconnect (struct GNUNET_ATS_SchedulingHandle *sh) 525reconnect (struct GNUNET_ATS_SchedulingHandle *sh)
530{ 526{
531 static const struct GNUNET_MQ_MessageHandler handlers[] = 527 GNUNET_MQ_hd_fixed_size (ats_session_release,
532 { { &process_ats_session_release_message, 528 GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE,
533 GNUNET_MESSAGE_TYPE_ATS_SESSION_RELEASE, 529 struct GNUNET_ATS_SessionReleaseMessage);
534 sizeof (struct GNUNET_ATS_SessionReleaseMessage) }, 530 GNUNET_MQ_hd_fixed_size (ats_address_suggestion,
535 { &process_ats_address_suggestion_message, 531 GNUNET_MESSAGE_TYPE_ATS_ADDRESS_SUGGESTION,
536 GNUNET_MESSAGE_TYPE_ATS_ADDRESS_SUGGESTION, 532 struct AddressSuggestionMessage);
537 sizeof (struct AddressSuggestionMessage) }, 533 struct GNUNET_MQ_MessageHandler handlers[] = {
538 { NULL, 0, 0 } }; 534 make_ats_session_release_handler (sh),
535 make_ats_address_suggestion_handler (sh),
536 GNUNET_MQ_handler_end ()
537 };
539 struct GNUNET_MQ_Envelope *ev; 538 struct GNUNET_MQ_Envelope *ev;
540 struct ClientStartMessage *init; 539 struct ClientStartMessage *init;
541 unsigned int i; 540 unsigned int i;