diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ats/ats_api_connectivity.c | 21 | ||||
-rw-r--r-- | src/ats/ats_api_performance.c | 22 | ||||
-rw-r--r-- | src/ats/ats_api_scanner.c | 13 | ||||
-rw-r--r-- | src/ats/ats_api_scheduling.c | 68 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 16 | ||||
-rw-r--r-- | src/transport/transport_api.c | 39 |
6 files changed, 88 insertions, 91 deletions
diff --git a/src/ats/ats_api_connectivity.c b/src/ats/ats_api_connectivity.c index 432f1ca35..495a29d93 100644 --- a/src/ats/ats_api_connectivity.c +++ b/src/ats/ats_api_connectivity.c | |||
@@ -28,6 +28,9 @@ | |||
28 | #include "ats.h" | 28 | #include "ats.h" |
29 | 29 | ||
30 | 30 | ||
31 | #define LOG(kind,...) GNUNET_log_from(kind, "ats-connectivity-api", __VA_ARGS__) | ||
32 | |||
33 | |||
31 | /** | 34 | /** |
32 | * Handle for ATS address suggestion requests. | 35 | * Handle for ATS address suggestion requests. |
33 | */ | 36 | */ |
@@ -149,9 +152,9 @@ error_handler (void *cls, | |||
149 | { | 152 | { |
150 | struct GNUNET_ATS_ConnectivityHandle *ch = cls; | 153 | struct GNUNET_ATS_ConnectivityHandle *ch = cls; |
151 | 154 | ||
152 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 155 | LOG (GNUNET_ERROR_TYPE_WARNING, |
153 | "ATS connection died (code %d), reconnecting\n", | 156 | "ATS connection died (code %d), reconnecting\n", |
154 | (int) error); | 157 | (int) error); |
155 | force_reconnect (ch); | 158 | force_reconnect (ch); |
156 | } | 159 | } |
157 | 160 | ||
@@ -308,9 +311,9 @@ GNUNET_ATS_connectivity_suggest (struct GNUNET_ATS_ConnectivityHandle *ch, | |||
308 | { | 311 | { |
309 | struct GNUNET_ATS_ConnectivitySuggestHandle *s; | 312 | struct GNUNET_ATS_ConnectivitySuggestHandle *s; |
310 | 313 | ||
311 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 314 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
312 | "Requesting ATS to suggest address for `%s'\n", | 315 | "Requesting ATS to suggest address for `%s'\n", |
313 | GNUNET_i2s (peer)); | 316 | GNUNET_i2s (peer)); |
314 | s = GNUNET_new (struct GNUNET_ATS_ConnectivitySuggestHandle); | 317 | s = GNUNET_new (struct GNUNET_ATS_ConnectivitySuggestHandle); |
315 | s->ch = ch; | 318 | s->ch = ch; |
316 | s->id = *peer; | 319 | s->id = *peer; |
@@ -344,9 +347,9 @@ GNUNET_ATS_connectivity_suggest_cancel (struct GNUNET_ATS_ConnectivitySuggestHan | |||
344 | struct GNUNET_MQ_Envelope *ev; | 347 | struct GNUNET_MQ_Envelope *ev; |
345 | struct RequestAddressMessage *m; | 348 | struct RequestAddressMessage *m; |
346 | 349 | ||
347 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 350 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
348 | "Telling ATS we no longer care for an address for `%s'\n", | 351 | "Telling ATS we no longer care for an address for `%s'\n", |
349 | GNUNET_i2s (&sh->id)); | 352 | GNUNET_i2s (&sh->id)); |
350 | GNUNET_assert (GNUNET_OK == | 353 | GNUNET_assert (GNUNET_OK == |
351 | GNUNET_CONTAINER_multipeermap_remove (ch->sug_requests, | 354 | GNUNET_CONTAINER_multipeermap_remove (ch->sug_requests, |
352 | &sh->id, | 355 | &sh->id, |
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c index e81f0d394..51980f079 100644 --- a/src/ats/ats_api_performance.c +++ b/src/ats/ats_api_performance.c | |||
@@ -27,6 +27,10 @@ | |||
27 | #include "gnunet_ats_service.h" | 27 | #include "gnunet_ats_service.h" |
28 | #include "ats.h" | 28 | #include "ats.h" |
29 | 29 | ||
30 | |||
31 | #define LOG(kind,...) GNUNET_log_from(kind, "ats-performance-api", __VA_ARGS__) | ||
32 | |||
33 | |||
30 | /** | 34 | /** |
31 | * Message in linked list we should send to the ATS service. The | 35 | * Message in linked list we should send to the ATS service. The |
32 | * actual binary message follows this struct. | 36 | * actual binary message follows this struct. |
@@ -520,11 +524,10 @@ process_ar_message (struct GNUNET_ATS_PerformanceHandle *ph, | |||
520 | GNUNET_break(0); | 524 | GNUNET_break(0); |
521 | return GNUNET_SYSERR; | 525 | return GNUNET_SYSERR; |
522 | } | 526 | } |
523 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 527 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
524 | "Received %s message for peer %s and plugin %s\n", | 528 | "Received ATS_ADDRESSLIST_RESPONSE message for peer %s and plugin %s\n", |
525 | "ATS_ADDRESSLIST_RESPONSE", | 529 | GNUNET_i2s (&pi->peer), |
526 | GNUNET_i2s (&pi->peer), | 530 | plugin_name); |
527 | plugin_name); | ||
528 | 531 | ||
529 | next = ph->addresslist_head; | 532 | next = ph->addresslist_head; |
530 | while (NULL != (alh = next)) | 533 | while (NULL != (alh = next)) |
@@ -546,9 +549,8 @@ process_ar_message (struct GNUNET_ATS_PerformanceHandle *ph, | |||
546 | (0 == ats_count) ) | 549 | (0 == ats_count) ) |
547 | { | 550 | { |
548 | /* Done */ | 551 | /* Done */ |
549 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 552 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
550 | "Received last message for %s\n", | 553 | "Received last message for ATS_ADDRESSLIST_RESPONSE\n"); |
551 | "ATS_ADDRESSLIST_RESPONSE"); | ||
552 | bandwidth_zero.value__ = htonl (0); | 554 | bandwidth_zero.value__ = htonl (0); |
553 | GNUNET_CONTAINER_DLL_remove (ph->addresslist_head, | 555 | GNUNET_CONTAINER_DLL_remove (ph->addresslist_head, |
554 | ph->addresslist_tail, | 556 | ph->addresslist_tail, |
@@ -622,8 +624,8 @@ process_ats_message (void *cls, | |||
622 | return; | 624 | return; |
623 | 625 | ||
624 | reconnect: | 626 | reconnect: |
625 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 627 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
626 | "Reconnecting!\n"); | 628 | "Reconnecting!\n"); |
627 | if (NULL != ph->th) | 629 | if (NULL != ph->th) |
628 | { | 630 | { |
629 | GNUNET_CLIENT_notify_transmit_ready_cancel (ph->th); | 631 | GNUNET_CLIENT_notify_transmit_ready_cancel (ph->th); |
diff --git a/src/ats/ats_api_scanner.c b/src/ats/ats_api_scanner.c index ce1c90567..64c02acf6 100644 --- a/src/ats/ats_api_scanner.c +++ b/src/ats/ats_api_scanner.c | |||
@@ -271,11 +271,12 @@ interface_proc (void *cls, | |||
271 | /* Store in list */ | 271 | /* Store in list */ |
272 | #if VERBOSE_ATS | 272 | #if VERBOSE_ATS |
273 | char * netmask = GNUNET_strdup (GNUNET_a2s((struct sockaddr *) net->netmask, addrlen)); | 273 | char * netmask = GNUNET_strdup (GNUNET_a2s((struct sockaddr *) net->netmask, addrlen)); |
274 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 274 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, |
275 | "Adding network `%s', netmask `%s'\n", | 275 | "ats-scanner-api", |
276 | GNUNET_a2s ((struct sockaddr *) net->network, | 276 | "Adding network `%s', netmask `%s'\n", |
277 | addrlen), | 277 | GNUNET_a2s ((struct sockaddr *) net->network, |
278 | netmask); | 278 | addrlen), |
279 | netmask); | ||
279 | GNUNET_free (netmask); | 280 | GNUNET_free (netmask); |
280 | #endif | 281 | #endif |
281 | GNUNET_CONTAINER_DLL_insert (is->net_head, | 282 | GNUNET_CONTAINER_DLL_insert (is->net_head, |
@@ -392,7 +393,7 @@ GNUNET_ATS_scanner_address_get_type (struct GNUNET_ATS_InterfaceScanner *is, | |||
392 | if (type == GNUNET_ATS_NET_UNSPECIFIED) | 393 | if (type == GNUNET_ATS_NET_UNSPECIFIED) |
393 | type = GNUNET_ATS_NET_WAN; | 394 | type = GNUNET_ATS_NET_WAN; |
394 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, | 395 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, |
395 | "ats-scheduling-api", | 396 | "ats-scanner-api", |
396 | "`%s' is in network `%s'\n", | 397 | "`%s' is in network `%s'\n", |
397 | GNUNET_a2s (addr, | 398 | GNUNET_a2s (addr, |
398 | addrlen), | 399 | addrlen), |
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index fb6df4494..e4db144d0 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -40,6 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | #define INTERFACE_PROCESSING_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2) | 41 | #define INTERFACE_PROCESSING_INTERVAL GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 2) |
42 | 42 | ||
43 | #define LOG(kind,...) GNUNET_log_from(kind, "ats-scheduling-api", __VA_ARGS__) | ||
43 | 44 | ||
44 | /** | 45 | /** |
45 | * Session ID we use if there is no session / slot. | 46 | * Session ID we use if there is no session / slot. |
@@ -417,11 +418,11 @@ process_ats_address_suggestion_message (void *cls, | |||
417 | if ( (0 == ntohl (m->bandwidth_out.value__)) && | 418 | if ( (0 == ntohl (m->bandwidth_out.value__)) && |
418 | (0 == ntohl (m->bandwidth_in.value__)) ) | 419 | (0 == ntohl (m->bandwidth_in.value__)) ) |
419 | { | 420 | { |
420 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 421 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
421 | "ATS suggests disconnect from peer `%s' with BW %u/%u\n", | 422 | "ATS suggests disconnect from peer `%s' with BW %u/%u\n", |
422 | GNUNET_i2s (&ar->address->peer), | 423 | GNUNET_i2s (&ar->address->peer), |
423 | (unsigned int) ntohl (m->bandwidth_out.value__), | 424 | (unsigned int) ntohl (m->bandwidth_out.value__), |
424 | (unsigned int) ntohl (m->bandwidth_in.value__)); | 425 | (unsigned int) ntohl (m->bandwidth_in.value__)); |
425 | sh->suggest_cb (sh->suggest_cb_cls, | 426 | sh->suggest_cb (sh->suggest_cb_cls, |
426 | &m->peer, | 427 | &m->peer, |
427 | NULL, | 428 | NULL, |
@@ -439,11 +440,11 @@ process_ats_address_suggestion_message (void *cls, | |||
439 | return; | 440 | return; |
440 | } | 441 | } |
441 | sh->backoff = GNUNET_TIME_UNIT_ZERO; | 442 | sh->backoff = GNUNET_TIME_UNIT_ZERO; |
442 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 443 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
443 | "ATS suggests address slot %u for peer `%s' using plugin %s\n", | 444 | "ATS suggests address slot %u for peer `%s' using plugin %s\n", |
444 | ar->slot, | 445 | ar->slot, |
445 | GNUNET_i2s (&ar->address->peer), | 446 | GNUNET_i2s (&ar->address->peer), |
446 | ar->address->transport_name); | 447 | ar->address->transport_name); |
447 | sh->suggest_cb (sh->suggest_cb_cls, | 448 | sh->suggest_cb (sh->suggest_cb_cls, |
448 | &m->peer, | 449 | &m->peer, |
449 | ar->address, | 450 | ar->address, |
@@ -466,9 +467,9 @@ error_handler (void *cls, | |||
466 | { | 467 | { |
467 | struct GNUNET_ATS_SchedulingHandle *sh = cls; | 468 | struct GNUNET_ATS_SchedulingHandle *sh = cls; |
468 | 469 | ||
469 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 470 | LOG (GNUNET_ERROR_TYPE_WARNING, |
470 | "ATS connection died (code %d), reconnecting\n", | 471 | "ATS connection died (code %d), reconnecting\n", |
471 | (int) error); | 472 | (int) error); |
472 | force_reconnect (sh); | 473 | force_reconnect (sh); |
473 | } | 474 | } |
474 | 475 | ||
@@ -507,12 +508,12 @@ send_add_address_message (struct GNUNET_ATS_SchedulingHandle *sh, | |||
507 | m->plugin_name_length = htons (namelen); | 508 | m->plugin_name_length = htons (namelen); |
508 | m->session_id = htonl (ar->slot); | 509 | m->session_id = htonl (ar->slot); |
509 | 510 | ||
510 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 511 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
511 | "Adding address for peer `%s', plugin `%s', session %p slot %u\n", | 512 | "Adding address for peer `%s', plugin `%s', session %p slot %u\n", |
512 | GNUNET_i2s (&ar->address->peer), | 513 | GNUNET_i2s (&ar->address->peer), |
513 | ar->address->transport_name, | 514 | ar->address->transport_name, |
514 | ar->session, | 515 | ar->session, |
515 | ar->slot); | 516 | ar->slot); |
516 | am = (struct GNUNET_ATS_Information *) &m[1]; | 517 | am = (struct GNUNET_ATS_Information *) &m[1]; |
517 | memcpy (am, | 518 | memcpy (am, |
518 | ar->ats, | 519 | ar->ats, |
@@ -706,7 +707,10 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh, | |||
706 | return NULL; | 707 | return NULL; |
707 | } | 708 | } |
708 | 709 | ||
709 | if (NOT_FOUND != find_session_id (sh, session, address)) | 710 | if (NOT_FOUND != |
711 | find_session_id (sh, | ||
712 | session, | ||
713 | address)) | ||
710 | { | 714 | { |
711 | /* Already existing, nothing todo, but this should not happen */ | 715 | /* Already existing, nothing todo, but this should not happen */ |
712 | GNUNET_break (0); | 716 | GNUNET_break (0); |
@@ -796,12 +800,12 @@ GNUNET_ATS_address_update (struct GNUNET_ATS_AddressRecord *ar, | |||
796 | struct GNUNET_ATS_Information *am; | 800 | struct GNUNET_ATS_Information *am; |
797 | size_t msize; | 801 | size_t msize; |
798 | 802 | ||
799 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 803 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
800 | "Updating address for peer `%s', plugin `%s', session %p slot %u\n", | 804 | "Updating address for peer `%s', plugin `%s', session %p slot %u\n", |
801 | GNUNET_i2s (&ar->address->peer), | 805 | GNUNET_i2s (&ar->address->peer), |
802 | ar->address->transport_name, | 806 | ar->address->transport_name, |
803 | ar->session, | 807 | ar->session, |
804 | ar->slot); | 808 | ar->slot); |
805 | GNUNET_array_grow (ar->ats, | 809 | GNUNET_array_grow (ar->ats, |
806 | ar->ats_count, | 810 | ar->ats_count, |
807 | ats_count); | 811 | ats_count); |
@@ -837,12 +841,12 @@ GNUNET_ATS_address_destroy (struct GNUNET_ATS_AddressRecord *ar) | |||
837 | struct GNUNET_MQ_Envelope *ev; | 841 | struct GNUNET_MQ_Envelope *ev; |
838 | struct AddressDestroyedMessage *m; | 842 | struct AddressDestroyedMessage *m; |
839 | 843 | ||
840 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 844 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
841 | "Deleting address for peer `%s', plugin `%s', slot %u session %p\n", | 845 | "Deleting address for peer `%s', plugin `%s', slot %u session %p\n", |
842 | GNUNET_i2s (&ar->address->peer), | 846 | GNUNET_i2s (&ar->address->peer), |
843 | ar->address->transport_name, | 847 | ar->address->transport_name, |
844 | ar->slot, | 848 | ar->slot, |
845 | ar->session); | 849 | ar->session); |
846 | GNUNET_break (NULL == ar->session); | 850 | GNUNET_break (NULL == ar->session); |
847 | ar->session = NULL; | 851 | ar->session = NULL; |
848 | ar->in_destroy = GNUNET_YES; | 852 | ar->in_destroy = GNUNET_YES; |
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index cea1dc14e..db863ae65 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -646,22 +646,12 @@ clients_handle_start (void *cls, | |||
646 | tc = setup_client (client); | 646 | tc = setup_client (client); |
647 | tc->send_payload = (0 != (2 & options)); | 647 | tc->send_payload = (0 != (2 & options)); |
648 | hello = GST_hello_get (); | 648 | hello = GST_hello_get (); |
649 | if (NULL == hello) | 649 | if (NULL != hello) |
650 | { | ||
651 | /* We are during startup and should have no neighbours, hence | ||
652 | iteration with NULL must work. The HELLO will be sent to | ||
653 | all clients once it has been created, so this should happen | ||
654 | next anyway, and certainly before we get neighbours. */ | ||
655 | GST_neighbours_iterate (NULL, NULL); | ||
656 | } | ||
657 | else | ||
658 | { | ||
659 | unicast (tc, | 650 | unicast (tc, |
660 | hello, | 651 | hello, |
661 | GNUNET_NO); | 652 | GNUNET_NO); |
662 | GST_neighbours_iterate (¬ify_client_about_neighbour, | 653 | GST_neighbours_iterate (¬ify_client_about_neighbour, |
663 | tc); | 654 | tc); |
664 | } | ||
665 | GNUNET_SERVER_receive_done (client, | 655 | GNUNET_SERVER_receive_done (client, |
666 | GNUNET_OK); | 656 | GNUNET_OK); |
667 | } | 657 | } |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 2da6e9a54..d672b4d46 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -689,8 +689,8 @@ demultiplexer (void *cls, | |||
689 | break; | 689 | break; |
690 | } | 690 | } |
691 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 691 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
692 | "Receiving `%s' message for `%4s'.\n", | 692 | "Receiving CONNECT message for `%4s'.\n", |
693 | "CONNECT", GNUNET_i2s (&cim->id)); | 693 | GNUNET_i2s (&cim->id)); |
694 | n = neighbour_find (h, &cim->id); | 694 | n = neighbour_find (h, &cim->id); |
695 | if (NULL != n) | 695 | if (NULL != n) |
696 | { | 696 | { |
@@ -699,8 +699,7 @@ demultiplexer (void *cls, | |||
699 | } | 699 | } |
700 | n = neighbour_add (h, &cim->id); | 700 | n = neighbour_add (h, &cim->id); |
701 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 701 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
702 | "Receiving `%s' message for `%4s' with quota %u\n", | 702 | "Receiving CONNECT message for `%4s' with quota %u\n", |
703 | "CONNECT", | ||
704 | GNUNET_i2s (&cim->id), | 703 | GNUNET_i2s (&cim->id), |
705 | ntohl (cim->quota_out.value__)); | 704 | ntohl (cim->quota_out.value__)); |
706 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, | 705 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, |
@@ -717,8 +716,8 @@ demultiplexer (void *cls, | |||
717 | dim = (const struct DisconnectInfoMessage *) msg; | 716 | dim = (const struct DisconnectInfoMessage *) msg; |
718 | GNUNET_break (ntohl (dim->reserved) == 0); | 717 | GNUNET_break (ntohl (dim->reserved) == 0); |
719 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 718 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
720 | "Receiving `%s' message for `%4s'.\n", | 719 | "Receiving DISCONNECT message for `%4s'.\n", |
721 | "DISCONNECT", GNUNET_i2s (&dim->peer)); | 720 | GNUNET_i2s (&dim->peer)); |
722 | n = neighbour_find (h, &dim->peer); | 721 | n = neighbour_find (h, &dim->peer); |
723 | if (NULL == n) | 722 | if (NULL == n) |
724 | { | 723 | { |
@@ -766,9 +765,6 @@ demultiplexer (void *cls, | |||
766 | } | 765 | } |
767 | break; | 766 | break; |
768 | case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV: | 767 | case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV: |
769 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
770 | "Receiving `%s' message.\n", | ||
771 | "RECV"); | ||
772 | if (size < | 768 | if (size < |
773 | sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader)) | 769 | sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader)) |
774 | { | 770 | { |
@@ -795,8 +791,6 @@ demultiplexer (void *cls, | |||
795 | h->rec (h->cls, &im->peer, imm); | 791 | h->rec (h->cls, &im->peer, imm); |
796 | break; | 792 | break; |
797 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: | 793 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: |
798 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
799 | "Receiving `%s' message.\n", "SET_QUOTA"); | ||
800 | if (size != sizeof (struct QuotaSetMessage)) | 794 | if (size != sizeof (struct QuotaSetMessage)) |
801 | { | 795 | { |
802 | GNUNET_break (0); | 796 | GNUNET_break (0); |
@@ -807,16 +801,18 @@ demultiplexer (void *cls, | |||
807 | if (NULL == n) | 801 | if (NULL == n) |
808 | break; | 802 | break; |
809 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 803 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
810 | "Receiving `%s' message for `%4s' with quota %u\n", | 804 | "Receiving SET_QUOTA message for `%4s' with quota %u\n", |
811 | "SET_QUOTA", | ||
812 | GNUNET_i2s (&qm->peer), | 805 | GNUNET_i2s (&qm->peer), |
813 | ntohl (qm->quota.value__)); | 806 | ntohl (qm->quota.value__)); |
814 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, qm->quota); | 807 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, |
808 | qm->quota); | ||
815 | break; | 809 | break; |
816 | default: | 810 | default: |
817 | LOG (GNUNET_ERROR_TYPE_ERROR, | 811 | LOG (GNUNET_ERROR_TYPE_ERROR, |
818 | _("Received unexpected message of type %u in %s:%u\n"), | 812 | _("Received unexpected message of type %u in %s:%u\n"), |
819 | ntohs (msg->type), __FILE__, __LINE__); | 813 | ntohs (msg->type), |
814 | __FILE__, | ||
815 | __LINE__); | ||
820 | GNUNET_break (0); | 816 | GNUNET_break (0); |
821 | break; | 817 | break; |
822 | } | 818 | } |
@@ -880,11 +876,14 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
880 | /* first send control messages */ | 876 | /* first send control messages */ |
881 | while ((NULL != (th = h->control_head)) && (th->notify_size <= size)) | 877 | while ((NULL != (th = h->control_head)) && (th->notify_size <= size)) |
882 | { | 878 | { |
883 | GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th); | 879 | GNUNET_CONTAINER_DLL_remove (h->control_head, |
880 | h->control_tail, | ||
881 | th); | ||
884 | nret = th->notify (th->notify_cls, size, &cbuf[ret]); | 882 | nret = th->notify (th->notify_cls, size, &cbuf[ret]); |
885 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 883 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
886 | "Added %u bytes of control message at %u\n", | 884 | "Added %u bytes of control message at %u\n", |
887 | nret, ret); | 885 | nret, |
886 | ret); | ||
888 | GNUNET_free (th); | 887 | GNUNET_free (th); |
889 | ret += nret; | 888 | ret += nret; |
890 | size -= nret; | 889 | size -= nret; |
@@ -1093,13 +1092,11 @@ send_start (void *cls, size_t size, void *buf) | |||
1093 | { | 1092 | { |
1094 | /* Can only be shutdown, just give up */ | 1093 | /* Can only be shutdown, just give up */ |
1095 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1094 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1096 | "Shutdown while trying to transmit `%s' request.\n", | 1095 | "Shutdown while trying to transmit START request.\n"); |
1097 | "START"); | ||
1098 | return 0; | 1096 | return 0; |
1099 | } | 1097 | } |
1100 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1098 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1101 | "Transmitting `%s' request.\n", | 1099 | "Transmitting START request.\n"); |
1102 | "START"); | ||
1103 | GNUNET_assert (size >= sizeof (struct StartMessage)); | 1100 | GNUNET_assert (size >= sizeof (struct StartMessage)); |
1104 | s.header.size = htons (sizeof (struct StartMessage)); | 1101 | s.header.size = htons (sizeof (struct StartMessage)); |
1105 | s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START); | 1102 | s.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_START); |