diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-10 13:50:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-10 13:50:43 +0000 |
commit | 0ae088e715401ce9a9681ade685a426058afc8db (patch) | |
tree | faaac933ed4b6f09dfec59dd50d02c16c3ad0fd7 /src/transport/transport_api.c | |
parent | fb384e12f002139ac86fe13bbdfc0bad5e5312e9 (diff) | |
download | gnunet-0ae088e715401ce9a9681ade685a426058afc8db.tar.gz gnunet-0ae088e715401ce9a9681ade685a426058afc8db.zip |
use LOG macro in transport_api.c
Diffstat (limited to 'src/transport/transport_api.c')
-rw-r--r-- | src/transport/transport_api.c | 135 |
1 files changed, 67 insertions, 68 deletions
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index b4d2ed9ff..3fdbcbd68 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -41,6 +41,8 @@ | |||
41 | #include "gnunet_transport_service.h" | 41 | #include "gnunet_transport_service.h" |
42 | #include "transport.h" | 42 | #include "transport.h" |
43 | 43 | ||
44 | #define LOG(kind,...) GNUNET_log_from (kind, "transport-api",__VA_ARGS__) | ||
45 | |||
44 | /** | 46 | /** |
45 | * How large to start with for the hashmap of neighbours. | 47 | * How large to start with for the hashmap of neighbours. |
46 | */ | 48 | */ |
@@ -340,8 +342,8 @@ neighbour_add (struct GNUNET_TRANSPORT_Handle *h, | |||
340 | struct Neighbour *n; | 342 | struct Neighbour *n; |
341 | 343 | ||
342 | #if DEBUG_TRANSPORT_API | 344 | #if DEBUG_TRANSPORT_API |
343 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating entry for neighbour `%4s'.\n", | 345 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Creating entry for neighbour `%4s'.\n", |
344 | GNUNET_i2s (pid)); | 346 | GNUNET_i2s (pid)); |
345 | #endif | 347 | #endif |
346 | n = GNUNET_malloc (sizeof (struct Neighbour)); | 348 | n = GNUNET_malloc (sizeof (struct Neighbour)); |
347 | n->id = *pid; | 349 | n->id = *pid; |
@@ -413,8 +415,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
413 | if (msg == NULL) | 415 | if (msg == NULL) |
414 | { | 416 | { |
415 | #if DEBUG_TRANSPORT_API | 417 | #if DEBUG_TRANSPORT_API |
416 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 418 | LOG (GNUNET_ERROR_TYPE_INFO, |
417 | "Error receiving from transport service, disconnecting temporarily.\n"); | 419 | "Error receiving from transport service, disconnecting temporarily.\n"); |
418 | #endif | 420 | #endif |
419 | disconnect_and_schedule_reconnect (h); | 421 | disconnect_and_schedule_reconnect (h); |
420 | return; | 422 | return; |
@@ -432,9 +434,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
432 | break; | 434 | break; |
433 | } | 435 | } |
434 | #if DEBUG_TRANSPORT_API | 436 | #if DEBUG_TRANSPORT_API |
435 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 437 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
436 | "Receiving (my own) `%s' message, I am `%4s'.\n", "HELLO", | 438 | "Receiving (my own) `%s' message, I am `%4s'.\n", "HELLO", |
437 | GNUNET_i2s (&me)); | 439 | GNUNET_i2s (&me)); |
438 | #endif | 440 | #endif |
439 | GNUNET_free_non_null (h->my_hello); | 441 | GNUNET_free_non_null (h->my_hello); |
440 | h->my_hello = NULL; | 442 | h->my_hello = NULL; |
@@ -470,8 +472,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
470 | break; | 472 | break; |
471 | } | 473 | } |
472 | #if DEBUG_TRANSPORT_API | 474 | #if DEBUG_TRANSPORT_API |
473 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", | 475 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", |
474 | "CONNECT", GNUNET_i2s (&cim->id)); | 476 | "CONNECT", GNUNET_i2s (&cim->id)); |
475 | #endif | 477 | #endif |
476 | n = neighbour_find (h, &cim->id); | 478 | n = neighbour_find (h, &cim->id); |
477 | if (n != NULL) | 479 | if (n != NULL) |
@@ -492,8 +494,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
492 | dim = (const struct DisconnectInfoMessage *) msg; | 494 | dim = (const struct DisconnectInfoMessage *) msg; |
493 | GNUNET_break (ntohl (dim->reserved) == 0); | 495 | GNUNET_break (ntohl (dim->reserved) == 0); |
494 | #if DEBUG_TRANSPORT_API_DISCONNECT | 496 | #if DEBUG_TRANSPORT_API_DISCONNECT |
495 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", | 497 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n", |
496 | "DISCONNECT", GNUNET_i2s (&dim->peer)); | 498 | "DISCONNECT", GNUNET_i2s (&dim->peer)); |
497 | #endif | 499 | #endif |
498 | n = neighbour_find (h, &dim->peer); | 500 | n = neighbour_find (h, &dim->peer); |
499 | if (n == NULL) | 501 | if (n == NULL) |
@@ -511,9 +513,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
511 | } | 513 | } |
512 | okm = (const struct SendOkMessage *) msg; | 514 | okm = (const struct SendOkMessage *) msg; |
513 | #if DEBUG_TRANSPORT_API | 515 | #if DEBUG_TRANSPORT_API |
514 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 516 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message, transmission %s.\n", |
515 | "Receiving `%s' message, transmission %s.\n", "SEND_OK", | 517 | "SEND_OK", ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed"); |
516 | ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed"); | ||
517 | #endif | 518 | #endif |
518 | n = neighbour_find (h, &okm->peer); | 519 | n = neighbour_find (h, &okm->peer); |
519 | if (n == NULL) | 520 | if (n == NULL) |
@@ -533,7 +534,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
533 | break; | 534 | break; |
534 | case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV: | 535 | case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV: |
535 | #if DEBUG_TRANSPORT_API | 536 | #if DEBUG_TRANSPORT_API |
536 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "RECV"); | 537 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "RECV"); |
537 | #endif | 538 | #endif |
538 | if (size < | 539 | if (size < |
539 | sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader)) | 540 | sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader)) |
@@ -553,9 +554,8 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
553 | break; | 554 | break; |
554 | } | 555 | } |
555 | #if DEBUG_TRANSPORT_API | 556 | #if DEBUG_TRANSPORT_API |
556 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 557 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Received message of type %u from `%4s'.\n", |
557 | "Received message of type %u from `%4s'.\n", ntohs (imm->type), | 558 | ntohs (imm->type), GNUNET_i2s (&im->peer)); |
558 | GNUNET_i2s (&im->peer)); | ||
559 | #endif | 559 | #endif |
560 | n = neighbour_find (h, &im->peer); | 560 | n = neighbour_find (h, &im->peer); |
561 | if (n == NULL) | 561 | if (n == NULL) |
@@ -568,7 +568,7 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
568 | break; | 568 | break; |
569 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: | 569 | case GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA: |
570 | #if DEBUG_TRANSPORT_API | 570 | #if DEBUG_TRANSPORT_API |
571 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "SET_QUOTA"); | 571 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "SET_QUOTA"); |
572 | #endif | 572 | #endif |
573 | if (size != sizeof (struct QuotaSetMessage)) | 573 | if (size != sizeof (struct QuotaSetMessage)) |
574 | { | 574 | { |
@@ -585,9 +585,9 @@ demultiplexer (void *cls, const struct GNUNET_MessageHeader *msg) | |||
585 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, qm->quota); | 585 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, qm->quota); |
586 | break; | 586 | break; |
587 | default: | 587 | default: |
588 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 588 | LOG (GNUNET_ERROR_TYPE_ERROR, |
589 | _("Received unexpected message of type %u in %s:%u\n"), | 589 | _("Received unexpected message of type %u in %s:%u\n"), |
590 | ntohs (msg->type), __FILE__, __LINE__); | 590 | ntohs (msg->type), __FILE__, __LINE__); |
591 | GNUNET_break (0); | 591 | GNUNET_break (0); |
592 | break; | 592 | break; |
593 | } | 593 | } |
@@ -655,8 +655,8 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
655 | GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th); | 655 | GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th); |
656 | nret = th->notify (th->notify_cls, size, &cbuf[ret]); | 656 | nret = th->notify (th->notify_cls, size, &cbuf[ret]); |
657 | #if DEBUG_TRANSPORT_API | 657 | #if DEBUG_TRANSPORT_API |
658 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 658 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Added %u bytes of control message at %u\n", |
659 | "Added %u bytes of control message at %u\n", nret, ret); | 659 | nret, ret); |
660 | #endif | 660 | #endif |
661 | GNUNET_free (th); | 661 | GNUNET_free (th); |
662 | ret += nret; | 662 | ret += nret; |
@@ -716,8 +716,8 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
716 | /* if there are more pending messages, try to schedule those */ | 716 | /* if there are more pending messages, try to schedule those */ |
717 | schedule_transmission (h); | 717 | schedule_transmission (h); |
718 | #if DEBUG_TRANSPORT_API | 718 | #if DEBUG_TRANSPORT_API |
719 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 719 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting %u bytes to transport service\n", |
720 | "Transmitting %u bytes to transport service\n", ret); | 720 | ret); |
721 | #endif | 721 | #endif |
722 | return ret; | 722 | return ret; |
723 | } | 723 | } |
@@ -752,9 +752,9 @@ schedule_transmission_task (void *cls, | |||
752 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); | 752 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); |
753 | n->hn = NULL; | 753 | n->hn = NULL; |
754 | #if DEBUG_TRANSPORT_API | 754 | #if DEBUG_TRANSPORT_API |
755 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 755 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
756 | "Signalling timeout for transmission to peer %s due to congestion\n", | 756 | "Signalling timeout for transmission to peer %s due to congestion\n", |
757 | GNUNET_i2s (&n->id)); | 757 | GNUNET_i2s (&n->id)); |
758 | #endif | 758 | #endif |
759 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); | 759 | GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL)); |
760 | GNUNET_free (th); | 760 | GNUNET_free (th); |
@@ -773,7 +773,7 @@ schedule_transmission_task (void *cls, | |||
773 | size = n->th->notify_size + sizeof (struct OutboundMessage); | 773 | size = n->th->notify_size + sizeof (struct OutboundMessage); |
774 | } | 774 | } |
775 | #if DEBUG_TRANSPORT_API | 775 | #if DEBUG_TRANSPORT_API |
776 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling notify_transmit_ready\n"); | 776 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Calling notify_transmit_ready\n"); |
777 | #endif | 777 | #endif |
778 | h->cth = | 778 | h->cth = |
779 | GNUNET_CLIENT_notify_transmit_ready (h->client, size, | 779 | GNUNET_CLIENT_notify_transmit_ready (h->client, size, |
@@ -811,9 +811,9 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h) | |||
811 | else | 811 | else |
812 | return; /* no work to be done */ | 812 | return; /* no work to be done */ |
813 | #if DEBUG_TRANSPORT_API | 813 | #if DEBUG_TRANSPORT_API |
814 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 814 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
815 | "Scheduling next transmission to service in %llu ms\n", | 815 | "Scheduling next transmission to service in %llu ms\n", |
816 | (unsigned long long) delay.rel_value); | 816 | (unsigned long long) delay.rel_value); |
817 | #endif | 817 | #endif |
818 | h->quota_task = | 818 | h->quota_task = |
819 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h); | 819 | GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h); |
@@ -837,8 +837,8 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h, size_t size, | |||
837 | struct GNUNET_TRANSPORT_TransmitHandle *th; | 837 | struct GNUNET_TRANSPORT_TransmitHandle *th; |
838 | 838 | ||
839 | #if DEBUG_TRANSPORT_API | 839 | #if DEBUG_TRANSPORT_API |
840 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 840 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Control transmit of %u bytes requested\n", |
841 | "Control transmit of %u bytes requested\n", size); | 841 | size); |
842 | #endif | 842 | #endif |
843 | th = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TransmitHandle)); | 843 | th = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_TransmitHandle)); |
844 | th->notify = notify; | 844 | th->notify = notify; |
@@ -867,13 +867,13 @@ send_start (void *cls, size_t size, void *buf) | |||
867 | { | 867 | { |
868 | /* Can only be shutdown, just give up */ | 868 | /* Can only be shutdown, just give up */ |
869 | #if DEBUG_TRANSPORT_API | 869 | #if DEBUG_TRANSPORT_API |
870 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 870 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
871 | "Shutdown while trying to transmit `%s' request.\n", "START"); | 871 | "Shutdown while trying to transmit `%s' request.\n", "START"); |
872 | #endif | 872 | #endif |
873 | return 0; | 873 | return 0; |
874 | } | 874 | } |
875 | #if DEBUG_TRANSPORT_API | 875 | #if DEBUG_TRANSPORT_API |
876 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START"); | 876 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "START"); |
877 | #endif | 877 | #endif |
878 | GNUNET_assert (size >= sizeof (struct StartMessage)); | 878 | GNUNET_assert (size >= sizeof (struct StartMessage)); |
879 | s.header.size = htons (sizeof (struct StartMessage)); | 879 | s.header.size = htons (sizeof (struct StartMessage)); |
@@ -905,7 +905,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
905 | return; | 905 | return; |
906 | } | 906 | } |
907 | #if DEBUG_TRANSPORT_API | 907 | #if DEBUG_TRANSPORT_API |
908 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); | 908 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n"); |
909 | #endif | 909 | #endif |
910 | GNUNET_assert (h->client == NULL); | 910 | GNUNET_assert (h->client == NULL); |
911 | GNUNET_assert (h->control_head == NULL); | 911 | GNUNET_assert (h->control_head == NULL); |
@@ -952,9 +952,9 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h) | |||
952 | GNUNET_free (th); | 952 | GNUNET_free (th); |
953 | } | 953 | } |
954 | #if DEBUG_TRANSPORT_API | 954 | #if DEBUG_TRANSPORT_API |
955 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 955 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
956 | "Scheduling task to reconnect to transport service in %llu ms.\n", | 956 | "Scheduling task to reconnect to transport service in %llu ms.\n", |
957 | h->reconnect_delay.rel_value); | 957 | h->reconnect_delay.rel_value); |
958 | #endif | 958 | #endif |
959 | h->reconnect_task = | 959 | h->reconnect_task = |
960 | GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h); | 960 | GNUNET_SCHEDULER_add_delayed (h->reconnect_delay, &reconnect, h); |
@@ -1009,9 +1009,9 @@ send_set_quota (void *cls, size_t size, void *buf) | |||
1009 | return 0; | 1009 | return 0; |
1010 | } | 1010 | } |
1011 | #if DEBUG_TRANSPORT_API | 1011 | #if DEBUG_TRANSPORT_API |
1012 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1012 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1013 | "Transmitting `%s' request with respect to `%4s'.\n", "SET_QUOTA", | 1013 | "Transmitting `%s' request with respect to `%4s'.\n", "SET_QUOTA", |
1014 | GNUNET_i2s (&sqc->target)); | 1014 | GNUNET_i2s (&sqc->target)); |
1015 | #endif | 1015 | #endif |
1016 | GNUNET_assert (size >= sizeof (struct QuotaSetMessage)); | 1016 | GNUNET_assert (size >= sizeof (struct QuotaSetMessage)); |
1017 | msg.header.size = htons (sizeof (struct QuotaSetMessage)); | 1017 | msg.header.size = htons (sizeof (struct QuotaSetMessage)); |
@@ -1045,22 +1045,21 @@ GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, | |||
1045 | n = neighbour_find (handle, target); | 1045 | n = neighbour_find (handle, target); |
1046 | if (NULL == n) | 1046 | if (NULL == n) |
1047 | { | 1047 | { |
1048 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1048 | LOG (GNUNET_ERROR_TYPE_ERROR, |
1049 | "Quota changed to %u for peer `%s', but I have no such neighbour!\n", | 1049 | "Quota changed to %u for peer `%s', but I have no such neighbour!\n", |
1050 | (unsigned int) ntohl (quota_out.value__), GNUNET_i2s (target)); | 1050 | (unsigned int) ntohl (quota_out.value__), GNUNET_i2s (target)); |
1051 | return; | 1051 | return; |
1052 | } | 1052 | } |
1053 | GNUNET_assert (NULL != handle->client); | 1053 | GNUNET_assert (NULL != handle->client); |
1054 | #if DEBUG_TRANSPORT_API | 1054 | #if DEBUG_TRANSPORT_API |
1055 | if (ntohl (quota_out.value__) != n->out_tracker.available_bytes_per_s__) | 1055 | if (ntohl (quota_out.value__) != n->out_tracker.available_bytes_per_s__) |
1056 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1056 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Quota changed from %u to %u for peer `%s'\n", |
1057 | "Quota changed from %u to %u for peer `%s'\n", | 1057 | (unsigned int) n->out_tracker.available_bytes_per_s__, |
1058 | (unsigned int) n->out_tracker.available_bytes_per_s__, | 1058 | (unsigned int) ntohl (quota_out.value__), GNUNET_i2s (target)); |
1059 | (unsigned int) ntohl (quota_out.value__), GNUNET_i2s (target)); | ||
1060 | else | 1059 | else |
1061 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Quota remains at %u for peer `%s'\n", | 1060 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Quota remains at %u for peer `%s'\n", |
1062 | (unsigned int) n->out_tracker.available_bytes_per_s__, | 1061 | (unsigned int) n->out_tracker.available_bytes_per_s__, |
1063 | GNUNET_i2s (target)); | 1062 | GNUNET_i2s (target)); |
1064 | #endif | 1063 | #endif |
1065 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, quota_out); | 1064 | GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, quota_out); |
1066 | sqc = GNUNET_malloc (sizeof (struct SetQuotaContext)); | 1065 | sqc = GNUNET_malloc (sizeof (struct SetQuotaContext)); |
@@ -1091,9 +1090,9 @@ send_try_connect (void *cls, size_t size, void *buf) | |||
1091 | return 0; | 1090 | return 0; |
1092 | } | 1091 | } |
1093 | #if DEBUG_TRANSPORT_API | 1092 | #if DEBUG_TRANSPORT_API |
1094 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1093 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1095 | "Transmitting `%s' request with respect to `%4s'.\n", | 1094 | "Transmitting `%s' request with respect to `%4s'.\n", "REQUEST_CONNECT", |
1096 | "REQUEST_CONNECT", GNUNET_i2s (pid)); | 1095 | GNUNET_i2s (pid)); |
1097 | #endif | 1096 | #endif |
1098 | GNUNET_assert (size >= sizeof (struct TransportRequestConnectMessage)); | 1097 | GNUNET_assert (size >= sizeof (struct TransportRequestConnectMessage)); |
1099 | msg.header.size = htons (sizeof (struct TransportRequestConnectMessage)); | 1098 | msg.header.size = htons (sizeof (struct TransportRequestConnectMessage)); |
@@ -1146,14 +1145,14 @@ send_hello (void *cls, size_t size, void *buf) | |||
1146 | if (buf == NULL) | 1145 | if (buf == NULL) |
1147 | { | 1146 | { |
1148 | #if DEBUG_TRANSPORT_TIMEOUT | 1147 | #if DEBUG_TRANSPORT_TIMEOUT |
1149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1148 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1150 | "Timeout while trying to transmit `%s' request.\n", "HELLO"); | 1149 | "Timeout while trying to transmit `%s' request.\n", "HELLO"); |
1151 | #endif | 1150 | #endif |
1152 | GNUNET_free (msg); | 1151 | GNUNET_free (msg); |
1153 | return 0; | 1152 | return 0; |
1154 | } | 1153 | } |
1155 | #if DEBUG_TRANSPORT_API | 1154 | #if DEBUG_TRANSPORT_API |
1156 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "HELLO"); | 1155 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", "HELLO"); |
1157 | #endif | 1156 | #endif |
1158 | ssize = ntohs (msg->size); | 1157 | ssize = ntohs (msg->size); |
1159 | GNUNET_assert (size >= ssize); | 1158 | GNUNET_assert (size >= ssize); |
@@ -1197,9 +1196,9 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
1197 | msg = GNUNET_malloc (size); | 1196 | msg = GNUNET_malloc (size); |
1198 | memcpy (msg, hello, size); | 1197 | memcpy (msg, hello, size); |
1199 | #if DEBUG_TRANSPORT_API | 1198 | #if DEBUG_TRANSPORT_API |
1200 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1199 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1201 | "Offering `%s' message of `%4s' to transport for validation.\n", | 1200 | "Offering `%s' message of `%4s' to transport for validation.\n", "HELLO", |
1202 | "HELLO", GNUNET_i2s (&peer)); | 1201 | GNUNET_i2s (&peer)); |
1203 | #endif | 1202 | #endif |
1204 | schedule_control_transmit (handle, size, &send_hello, msg); | 1203 | schedule_control_transmit (handle, size, &send_hello, msg); |
1205 | } | 1204 | } |
@@ -1300,7 +1299,7 @@ void | |||
1300 | GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) | 1299 | GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle) |
1301 | { | 1300 | { |
1302 | #if DEBUG_TRANSPORT_API | 1301 | #if DEBUG_TRANSPORT_API |
1303 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n"); | 1302 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n"); |
1304 | #endif | 1303 | #endif |
1305 | /* this disconnects all neighbours... */ | 1304 | /* this disconnects all neighbours... */ |
1306 | if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK) | 1305 | if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK) |
@@ -1387,9 +1386,9 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, | |||
1387 | if (delay.rel_value > timeout.rel_value) | 1386 | if (delay.rel_value > timeout.rel_value) |
1388 | delay.rel_value = 0; /* notify immediately (with failure) */ | 1387 | delay.rel_value = 0; /* notify immediately (with failure) */ |
1389 | #if DEBUG_TRANSPORT_API | 1388 | #if DEBUG_TRANSPORT_API |
1390 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1389 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1391 | "Bandwidth tracker allows next transmission to peer %s in %llu ms\n", | 1390 | "Bandwidth tracker allows next transmission to peer %s in %llu ms\n", |
1392 | GNUNET_i2s (target), (unsigned long long) delay.rel_value); | 1391 | GNUNET_i2s (target), (unsigned long long) delay.rel_value); |
1393 | #endif | 1392 | #endif |
1394 | n->hn = GNUNET_CONTAINER_heap_insert (handle->ready_heap, n, delay.rel_value); | 1393 | n->hn = GNUNET_CONTAINER_heap_insert (handle->ready_heap, n, delay.rel_value); |
1395 | schedule_transmission (handle); | 1394 | schedule_transmission (handle); |