aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-19 13:10:03 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-19 13:10:03 +0000
commit57f5bfafca87873061bc6aba6f47439d59343045 (patch)
treeca54754d01e76a9c538492d937433fcad9a8e70f /src/ats
parentca31992cb873c9cad826841ebae014ef2d614cf5 (diff)
downloadgnunet-57f5bfafca87873061bc6aba6f47439d59343045.tar.gz
gnunet-57f5bfafca87873061bc6aba6f47439d59343045.zip
major bugfixes in performance api implementation, some logging
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/ats_api_performance.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index d45c6738b..ba124fe21 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -335,11 +335,6 @@ process_rr_message (struct GNUNET_ATS_PerformanceHandle *ph,
335 struct GNUNET_ATS_ReservationContext *rc; 335 struct GNUNET_ATS_ReservationContext *rc;
336 int32_t amount; 336 int32_t amount;
337 337
338 if (ph->infocb == NULL)
339 {
340 GNUNET_break (0);
341 return GNUNET_SYSERR;
342 }
343 if (ntohs (msg->size) < sizeof (struct ReservationResultMessage)) 338 if (ntohs (msg->size) < sizeof (struct ReservationResultMessage))
344 { 339 {
345 GNUNET_break (0); 340 GNUNET_break (0);
@@ -568,13 +563,14 @@ GNUNET_ATS_reserve_bandwidth (struct GNUNET_ATS_PerformanceHandle *ph,
568 p->size = sizeof (struct ReservationRequestMessage); 563 p->size = sizeof (struct ReservationRequestMessage);
569 p->is_init = GNUNET_NO; 564 p->is_init = GNUNET_NO;
570 m = (struct ReservationRequestMessage*) &p[1]; 565 m = (struct ReservationRequestMessage*) &p[1];
571 m->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE); 566 m->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_RESERVATION_REQUEST);
572 m->header.size = htons (sizeof (struct ReservationRequestMessage)); 567 m->header.size = htons (sizeof (struct ReservationRequestMessage));
573 m->amount = htonl (amount); 568 m->amount = htonl (amount);
574 m->peer = *peer; 569 m->peer = *peer;
575 GNUNET_CONTAINER_DLL_insert_tail (ph->pending_head, 570 GNUNET_CONTAINER_DLL_insert_tail (ph->pending_head,
576 ph->pending_tail, 571 ph->pending_tail,
577 p); 572 p);
573 do_transmit (ph);
578 return rc; 574 return rc;
579} 575}
580 576
@@ -639,7 +635,7 @@ GNUNET_ATS_change_preference (struct GNUNET_ATS_PerformanceHandle *ph,
639 p->size = msize; 635 p->size = msize;
640 p->is_init = GNUNET_NO; 636 p->is_init = GNUNET_NO;
641 m = (struct ChangePreferenceMessage*) &p[1]; 637 m = (struct ChangePreferenceMessage*) &p[1];
642 m->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_ADDRESS_UPDATE); 638 m->header.type = htons (GNUNET_MESSAGE_TYPE_ATS_PREFERENCE_CHANGE);
643 m->header.size = htons (msize); 639 m->header.size = htons (msize);
644 m->num_preferences = htonl (count); 640 m->num_preferences = htonl (count);
645 m->peer = *peer; 641 m->peer = *peer;
@@ -667,6 +663,7 @@ GNUNET_ATS_change_preference (struct GNUNET_ATS_PerformanceHandle *ph,
667 GNUNET_CONTAINER_DLL_insert_tail (ph->pending_head, 663 GNUNET_CONTAINER_DLL_insert_tail (ph->pending_head,
668 ph->pending_tail, 664 ph->pending_tail,
669 p); 665 p);
666 do_transmit (ph);
670} 667}
671 668
672/* end of ats_api_performance.c */ 669/* end of ats_api_performance.c */