aboutsummaryrefslogtreecommitdiff
path: root/src/ats/ats_api_performance.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-03-20 09:33:04 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-03-20 09:33:04 +0000
commit9e64a03e8979bd9139f3ccf6222f24fe541cda9e (patch)
tree07dcc1f5cb98fcf81794dd52633aa12b64f26d41 /src/ats/ats_api_performance.c
parent110f7cda16a96257ad4bdcf604b1e188a00a1200 (diff)
downloadgnunet-9e64a03e8979bd9139f3ccf6222f24fe541cda9e.tar.gz
gnunet-9e64a03e8979bd9139f3ccf6222f24fe541cda9e.zip
initial cb
Diffstat (limited to 'src/ats/ats_api_performance.c')
-rw-r--r--src/ats/ats_api_performance.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index cbf18a0cc..34f3a232e 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -582,14 +582,23 @@ process_mr_message (struct GNUNET_ATS_PerformanceHandle *ph,
582 uint32_t ats_count; 582 uint32_t ats_count;
583 uint32_t id; 583 uint32_t id;
584 584
585 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
586 _("Received %s message\n"), "ATS_MONITOR_RESPONSE");
587
585 msg_size = ntohs (msg->size); 588 msg_size = ntohs (msg->size);
586 if (msg_size < sizeof (struct MonitorResponseMessage)) 589 if (msg_size < sizeof (struct MonitorResponseMessage))
590 {
591 GNUNET_break (0);
587 return GNUNET_SYSERR; 592 return GNUNET_SYSERR;
593 }
588 594
589 ats_count = ntohl (mrm->ats_count); 595 ats_count = ntohl (mrm->ats_count);
590 if (msg_size != (sizeof (struct MonitorResponseMessage) + 596 if (msg_size != (sizeof (struct MonitorResponseMessage) +
591 ats_count * sizeof (struct GNUNET_ATS_Information))) 597 ats_count * sizeof (struct GNUNET_ATS_Information)))
592 return GNUNET_SYSERR; 598 {
599 GNUNET_break (0);
600 return GNUNET_SYSERR;
601 }
593 602
594 id = ntohl (mrm->id); 603 id = ntohl (mrm->id);
595 /* Do work here */ 604 /* Do work here */
@@ -600,7 +609,10 @@ process_mr_message (struct GNUNET_ATS_PerformanceHandle *ph,
600 } 609 }
601 610
602 if (NULL == cur) 611 if (NULL == cur)
603 return GNUNET_SYSERR; 612 {
613 GNUNET_break (0);
614 return GNUNET_SYSERR;
615 }
604 616
605 ats = (struct GNUNET_ATS_Information *) &mrm[1]; 617 ats = (struct GNUNET_ATS_Information *) &mrm[1];
606 cur->moncb (cur->moncb_cls, &mrm->peer, ats, ats_count); 618 cur->moncb (cur->moncb_cls, &mrm->peer, ats, ats_count);