diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-10 11:33:55 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-10-10 11:33:55 +0000 |
commit | 5f939eed860c82aa347fa920b0f956fab81bd94e (patch) | |
tree | dc980d9e596c2a63e097f5ba6ecbc76922a7015d /src/transport/transport_api.c | |
parent | f98b90402146449b2b79da806e1dae6a351ddcd7 (diff) | |
download | gnunet-5f939eed860c82aa347fa920b0f956fab81bd94e.tar.gz gnunet-5f939eed860c82aa347fa920b0f956fab81bd94e.zip |
quota changes
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index bf37b4ac6..b4d2ed9ff 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -401,6 +401,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
401 | const struct InboundMessage *im; | 401 | const struct InboundMessage *im; |
402 | const struct GNUNET_MessageHeader *imm; | 402 | const struct GNUNET_MessageHeader *imm; |
403 | const struct SendOkMessage *okm; | 403 | const struct SendOkMessage *okm; |
404 | const struct QuotaSetMessage *qm; | ||
404 | struct GNUNET_TRANSPORT_GetHelloHandle *hwl; | 405 | struct GNUNET_TRANSPORT_GetHelloHandle *hwl; |
405 | struct GNUNET_TRANSPORT_GetHelloHandle *next_hwl; | 406 | struct GNUNET_TRANSPORT_GetHelloHandle *next_hwl; |
406 | struct Neighbour *n; | 407 | struct Neighbour *n; |
@@ -565,6 +566,24 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
565 | if (h->rec != NULL) | 566 | if (h->rec != NULL) |
566 | h->rec (h->cls, &im->peer, imm, &im->ats, ats_count); | 567 | h->rec (h->cls, &im->peer, imm, &im->ats, ats_count); |
567 | break; | 568 | break; |
569 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: | ||
570 | #if DEBUG_TRANSPORT_API | ||
571 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "SET_QUOTA"); | ||
572 | #endif | ||
573 | if (size != sizeof (struct QuotaSetMessage)) | ||
574 | { | ||
575 | GNUNET_break (0); | ||
576 | break; | ||
577 | } | ||
578 | qm = (const struct QuotaSetMessage *) msg; | ||
579 | n = neighbour_find (h, &qm->peer); | ||
580 | if (n == NULL) | ||
581 | { | ||
582 | GNUNET_break (0); | ||
583 | break; | ||
584 | } | ||
585 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, qm->quota); | ||
586 | break; | ||
568 | default: | 587 | default: |
569 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 588 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
570 | _("Received unexpected message of type %u in %s:%u\n"), | 589 | _("Received unexpected message of type %u in %s:%u\n"), |