diff options
Diffstat (limited to 'src/core/core_api.c')
-rw-r--r-- | src/core/core_api.c | 63 |
1 files changed, 6 insertions, 57 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index ecfe8b478..d2eaa260d 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -367,9 +367,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
367 | struct GNUNET_CORE_Handle *h = cls; | 367 | struct GNUNET_CORE_Handle *h = cls; |
368 | 368 | ||
369 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 369 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
370 | #if DEBUG_CORE | ||
371 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CORE service after delay\n"); | 370 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CORE service after delay\n"); |
372 | #endif | ||
373 | reconnect (h); | 371 | reconnect (h); |
374 | } | 372 | } |
375 | 373 | ||
@@ -546,11 +544,9 @@ request_next_transmission (struct PeerRecord *pr) | |||
546 | smr->smr_id = htons (th->smr_id = pr->smr_id_gen++); | 544 | smr->smr_id = htons (th->smr_id = pr->smr_id_gen++); |
547 | GNUNET_CONTAINER_DLL_insert_tail (h->control_pending_head, | 545 | GNUNET_CONTAINER_DLL_insert_tail (h->control_pending_head, |
548 | h->control_pending_tail, cm); | 546 | h->control_pending_tail, cm); |
549 | #if DEBUG_CORE | ||
550 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 547 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
551 | "Adding SEND REQUEST for peer `%s' to message queue\n", | 548 | "Adding SEND REQUEST for peer `%s' to message queue\n", |
552 | GNUNET_i2s (&pr->peer)); | 549 | GNUNET_i2s (&pr->peer)); |
553 | #endif | ||
554 | trigger_next_request (h, GNUNET_NO); | 550 | trigger_next_request (h, GNUNET_NO); |
555 | } | 551 | } |
556 | 552 | ||
@@ -580,10 +576,8 @@ transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
580 | * us from the 'ready' list */ | 576 | * us from the 'ready' list */ |
581 | GNUNET_CONTAINER_DLL_remove (h->ready_peer_head, h->ready_peer_tail, pr); | 577 | GNUNET_CONTAINER_DLL_remove (h->ready_peer_head, h->ready_peer_tail, pr); |
582 | } | 578 | } |
583 | #if DEBUG_CORE | ||
584 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 579 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
585 | "Signalling timeout of request for transmission to CORE service\n"); | 580 | "Signalling timeout of request for transmission to CORE service\n"); |
586 | #endif | ||
587 | request_next_transmission (pr); | 581 | request_next_transmission (pr); |
588 | GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL)); | 582 | GNUNET_assert (0 == th->get_message (th->get_message_cls, 0, NULL)); |
589 | GNUNET_free (th); | 583 | GNUNET_free (th); |
@@ -609,10 +603,8 @@ transmit_message (void *cls, size_t size, void *buf) | |||
609 | h->cth = NULL; | 603 | h->cth = NULL; |
610 | if (buf == NULL) | 604 | if (buf == NULL) |
611 | { | 605 | { |
612 | #if DEBUG_CORE | ||
613 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 606 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
614 | "Transmission failed, initiating reconnect\n"); | 607 | "Transmission failed, initiating reconnect\n"); |
615 | #endif | ||
616 | reconnect_later (h); | 608 | reconnect_later (h); |
617 | return 0; | 609 | return 0; |
618 | } | 610 | } |
@@ -626,11 +618,9 @@ transmit_message (void *cls, size_t size, void *buf) | |||
626 | trigger_next_request (h, GNUNET_NO); | 618 | trigger_next_request (h, GNUNET_NO); |
627 | return 0; | 619 | return 0; |
628 | } | 620 | } |
629 | #if DEBUG_CORE | ||
630 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 621 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
631 | "Transmitting control message with %u bytes of type %u to core.\n", | 622 | "Transmitting control message with %u bytes of type %u to core.\n", |
632 | (unsigned int) msize, (unsigned int) ntohs (hdr->type)); | 623 | (unsigned int) msize, (unsigned int) ntohs (hdr->type)); |
633 | #endif | ||
634 | memcpy (buf, hdr, msize); | 624 | memcpy (buf, hdr, msize); |
635 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, | 625 | GNUNET_CONTAINER_DLL_remove (h->control_pending_head, |
636 | h->control_pending_tail, cm); | 626 | h->control_pending_tail, cm); |
@@ -660,11 +650,9 @@ transmit_message (void *cls, size_t size, void *buf) | |||
660 | GNUNET_SCHEDULER_cancel (pr->timeout_task); | 650 | GNUNET_SCHEDULER_cancel (pr->timeout_task); |
661 | pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 651 | pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
662 | } | 652 | } |
663 | #if DEBUG_CORE | ||
664 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 653 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
665 | "Transmitting SEND request to `%s' with %u bytes.\n", | 654 | "Transmitting SEND request to `%s' with %u bytes.\n", |
666 | GNUNET_i2s (&pr->peer), (unsigned int) th->msize); | 655 | GNUNET_i2s (&pr->peer), (unsigned int) th->msize); |
667 | #endif | ||
668 | sm = (struct SendMessage *) buf; | 656 | sm = (struct SendMessage *) buf; |
669 | sm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND); | 657 | sm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_SEND); |
670 | sm->priority = htonl (th->priority); | 658 | sm->priority = htonl (th->priority); |
@@ -676,28 +664,22 @@ transmit_message (void *cls, size_t size, void *buf) | |||
676 | th->get_message (th->get_message_cls, | 664 | th->get_message (th->get_message_cls, |
677 | size - sizeof (struct SendMessage), &sm[1]); | 665 | size - sizeof (struct SendMessage), &sm[1]); |
678 | 666 | ||
679 | #if DEBUG_CORE | ||
680 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 667 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
681 | "Transmitting SEND request to `%s' yielded %u bytes.\n", | 668 | "Transmitting SEND request to `%s' yielded %u bytes.\n", |
682 | GNUNET_i2s (&pr->peer), ret); | 669 | GNUNET_i2s (&pr->peer), ret); |
683 | #endif | ||
684 | GNUNET_free (th); | 670 | GNUNET_free (th); |
685 | if (0 == ret) | 671 | if (0 == ret) |
686 | { | 672 | { |
687 | #if DEBUG_CORE | ||
688 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 673 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
689 | "Size of clients message to peer %s is 0!\n", | 674 | "Size of clients message to peer %s is 0!\n", |
690 | GNUNET_i2s (&pr->peer)); | 675 | GNUNET_i2s (&pr->peer)); |
691 | #endif | ||
692 | /* client decided to send nothing! */ | 676 | /* client decided to send nothing! */ |
693 | request_next_transmission (pr); | 677 | request_next_transmission (pr); |
694 | return 0; | 678 | return 0; |
695 | } | 679 | } |
696 | #if DEBUG_CORE | ||
697 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 680 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
698 | "Produced SEND message to core with %u bytes payload\n", | 681 | "Produced SEND message to core with %u bytes payload\n", |
699 | (unsigned int) ret); | 682 | (unsigned int) ret); |
700 | #endif | ||
701 | GNUNET_assert (ret >= sizeof (struct GNUNET_MessageHeader)); | 683 | GNUNET_assert (ret >= sizeof (struct GNUNET_MessageHeader)); |
702 | if (ret + sizeof (struct SendMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) | 684 | if (ret + sizeof (struct SendMessage) >= GNUNET_SERVER_MAX_MESSAGE_SIZE) |
703 | { | 685 | { |
@@ -729,17 +711,13 @@ trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down) | |||
729 | 711 | ||
730 | if ((GNUNET_YES == h->currently_down) && (ignore_currently_down == GNUNET_NO)) | 712 | if ((GNUNET_YES == h->currently_down) && (ignore_currently_down == GNUNET_NO)) |
731 | { | 713 | { |
732 | #if DEBUG_CORE | ||
733 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 714 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
734 | "Core connection down, not processing queue\n"); | 715 | "Core connection down, not processing queue\n"); |
735 | #endif | ||
736 | return; | 716 | return; |
737 | } | 717 | } |
738 | if (NULL != h->cth) | 718 | if (NULL != h->cth) |
739 | { | 719 | { |
740 | #if DEBUG_CORE | ||
741 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Request pending, not processing queue\n"); | 720 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Request pending, not processing queue\n"); |
742 | #endif | ||
743 | return; | 721 | return; |
744 | } | 722 | } |
745 | if (h->control_pending_head != NULL) | 723 | if (h->control_pending_head != NULL) |
@@ -751,10 +729,8 @@ trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down) | |||
751 | h->ready_peer_head->pending_head->msize + sizeof (struct SendMessage); | 729 | h->ready_peer_head->pending_head->msize + sizeof (struct SendMessage); |
752 | else | 730 | else |
753 | { | 731 | { |
754 | #if DEBUG_CORE | ||
755 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 732 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
756 | "Request queue empty, not processing queue\n"); | 733 | "Request queue empty, not processing queue\n"); |
757 | #endif | ||
758 | return; /* no pending message */ | 734 | return; /* no pending message */ |
759 | } | 735 | } |
760 | h->cth = | 736 | h->cth = |
@@ -800,11 +776,9 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
800 | return; | 776 | return; |
801 | } | 777 | } |
802 | msize = ntohs (msg->size); | 778 | msize = ntohs (msg->size); |
803 | #if DEBUG_CORE > 2 | ||
804 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 779 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
805 | "Processing message of type %u and size %u from core service\n", | 780 | "Processing message of type %u and size %u from core service\n", |
806 | ntohs (msg->type), msize); | 781 | ntohs (msg->type), msize); |
807 | #endif | ||
808 | switch (ntohs (msg->type)) | 782 | switch (ntohs (msg->type)) |
809 | { | 783 | { |
810 | case GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY: | 784 | case GNUNET_MESSAGE_TYPE_CORE_INIT_REPLY: |
@@ -828,18 +802,14 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
828 | { | 802 | { |
829 | /* mark so we don't call init on reconnect */ | 803 | /* mark so we don't call init on reconnect */ |
830 | h->init = NULL; | 804 | h->init = NULL; |
831 | #if DEBUG_CORE | ||
832 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to core service of peer `%s'.\n", | 805 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to core service of peer `%s'.\n", |
833 | GNUNET_i2s (&h->me)); | 806 | GNUNET_i2s (&h->me)); |
834 | #endif | ||
835 | init (h->cls, h, &h->me); | 807 | init (h->cls, h, &h->me); |
836 | } | 808 | } |
837 | else | 809 | else |
838 | { | 810 | { |
839 | #if DEBUG_CORE | ||
840 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 811 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
841 | "Successfully reconnected to core service.\n"); | 812 | "Successfully reconnected to core service.\n"); |
842 | #endif | ||
843 | } | 813 | } |
844 | /* fake 'connect to self' */ | 814 | /* fake 'connect to self' */ |
845 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &h->me.hashPubKey); | 815 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &h->me.hashPubKey); |
@@ -871,11 +841,9 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
871 | reconnect_later (h); | 841 | reconnect_later (h); |
872 | return; | 842 | return; |
873 | } | 843 | } |
874 | #if DEBUG_CORE | ||
875 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 844 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
876 | "Received notification about connection from `%s'.\n", | 845 | "Received notification about connection from `%s'.\n", |
877 | GNUNET_i2s (&cnm->peer)); | 846 | GNUNET_i2s (&cnm->peer)); |
878 | #endif | ||
879 | if (0 == memcmp (&h->me, &cnm->peer, sizeof (struct GNUNET_PeerIdentity))) | 847 | if (0 == memcmp (&h->me, &cnm->peer, sizeof (struct GNUNET_PeerIdentity))) |
880 | { | 848 | { |
881 | /* connect to self!? */ | 849 | /* connect to self!? */ |
@@ -915,11 +883,9 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
915 | return; | 883 | return; |
916 | } | 884 | } |
917 | GNUNET_break (0 == ntohl (dnm->reserved)); | 885 | GNUNET_break (0 == ntohl (dnm->reserved)); |
918 | #if DEBUG_CORE | ||
919 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 886 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
920 | "Received notification about disconnect from `%s'.\n", | 887 | "Received notification about disconnect from `%s'.\n", |
921 | GNUNET_i2s (&dnm->peer)); | 888 | GNUNET_i2s (&dnm->peer)); |
922 | #endif | ||
923 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &dnm->peer.hashPubKey); | 889 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &dnm->peer.hashPubKey); |
924 | if (pr == NULL) | 890 | if (pr == NULL) |
925 | { | 891 | { |
@@ -954,11 +920,9 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
954 | return; | 920 | return; |
955 | } | 921 | } |
956 | em = (const struct GNUNET_MessageHeader *) &(&ntm->ats)[ats_count + 1]; | 922 | em = (const struct GNUNET_MessageHeader *) &(&ntm->ats)[ats_count + 1]; |
957 | #if DEBUG_CORE | ||
958 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 923 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
959 | "Received message of type %u and size %u from peer `%4s'\n", | 924 | "Received message of type %u and size %u from peer `%4s'\n", |
960 | ntohs (em->type), ntohs (em->size), GNUNET_i2s (&ntm->peer)); | 925 | ntohs (em->type), ntohs (em->size), GNUNET_i2s (&ntm->peer)); |
961 | #endif | ||
962 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &ntm->peer.hashPubKey); | 926 | pr = GNUNET_CONTAINER_multihashmap_get (h->peers, &ntm->peer.hashPubKey); |
963 | if (pr == NULL) | 927 | if (pr == NULL) |
964 | { | 928 | { |
@@ -1033,11 +997,9 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1033 | reconnect_later (h); | 997 | reconnect_later (h); |
1034 | return; | 998 | return; |
1035 | } | 999 | } |
1036 | #if DEBUG_CORE | ||
1037 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1000 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1038 | "Received notification about transmission to `%s'.\n", | 1001 | "Received notification about transmission to `%s'.\n", |
1039 | GNUNET_i2s (&ntm->peer)); | 1002 | GNUNET_i2s (&ntm->peer)); |
1040 | #endif | ||
1041 | if ((GNUNET_NO == h->outbound_hdr_only) && | 1003 | if ((GNUNET_NO == h->outbound_hdr_only) && |
1042 | (msize != | 1004 | (msize != |
1043 | ntohs (em->size) + sizeof (struct NotifyTrafficMessage) + | 1005 | ntohs (em->size) + sizeof (struct NotifyTrafficMessage) + |
@@ -1069,11 +1031,9 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1069 | reconnect_later (h); | 1031 | reconnect_later (h); |
1070 | return; | 1032 | return; |
1071 | } | 1033 | } |
1072 | #if DEBUG_CORE | ||
1073 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1034 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1074 | "Received notification about transmission readiness to `%s'.\n", | 1035 | "Received notification about transmission readiness to `%s'.\n", |
1075 | GNUNET_i2s (&smr->peer)); | 1036 | GNUNET_i2s (&smr->peer)); |
1076 | #endif | ||
1077 | if (pr->pending_head == NULL) | 1037 | if (pr->pending_head == NULL) |
1078 | { | 1038 | { |
1079 | /* request must have been cancelled between the original request | 1039 | /* request must have been cancelled between the original request |
@@ -1123,10 +1083,8 @@ init_done_task (void *cls, int success) | |||
1123 | return; /* shutdown */ | 1083 | return; /* shutdown */ |
1124 | if (success == GNUNET_NO) | 1084 | if (success == GNUNET_NO) |
1125 | { | 1085 | { |
1126 | #if DEBUG_CORE | ||
1127 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1086 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1128 | "Failed to exchange INIT with core, retrying\n"); | 1087 | "Failed to exchange INIT with core, retrying\n"); |
1129 | #endif | ||
1130 | if (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK) | 1088 | if (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK) |
1131 | reconnect_later (h); | 1089 | reconnect_later (h); |
1132 | return; | 1090 | return; |
@@ -1152,9 +1110,6 @@ reconnect (struct GNUNET_CORE_Handle *h) | |||
1152 | uint16_t *ts; | 1110 | uint16_t *ts; |
1153 | unsigned int hpos; | 1111 | unsigned int hpos; |
1154 | 1112 | ||
1155 | #if DEBUG_CORE | ||
1156 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnecting to CORE service\n"); | ||
1157 | #endif | ||
1158 | GNUNET_assert (h->client == NULL); | 1113 | GNUNET_assert (h->client == NULL); |
1159 | GNUNET_assert (h->currently_down == GNUNET_YES); | 1114 | GNUNET_assert (h->currently_down == GNUNET_YES); |
1160 | h->client = GNUNET_CLIENT_connect ("core", h->cfg); | 1115 | h->client = GNUNET_CLIENT_connect ("core", h->cfg); |
@@ -1185,6 +1140,10 @@ reconnect (struct GNUNET_CORE_Handle *h) | |||
1185 | else | 1140 | else |
1186 | opt |= GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND; | 1141 | opt |= GNUNET_CORE_OPTION_SEND_FULL_OUTBOUND; |
1187 | } | 1142 | } |
1143 | LOG (GNUNET_ERROR_TYPE_INFO, | ||
1144 | "(Re)connecting to CORE service, monitoring messages of type %u\n", | ||
1145 | opt); | ||
1146 | |||
1188 | init->options = htonl (opt); | 1147 | init->options = htonl (opt); |
1189 | ts = (uint16_t *) & init[1]; | 1148 | ts = (uint16_t *) & init[1]; |
1190 | for (hpos = 0; hpos < h->hcnt; hpos++) | 1149 | for (hpos = 0; hpos < h->hcnt; hpos++) |
@@ -1203,8 +1162,8 @@ reconnect (struct GNUNET_CORE_Handle *h) | |||
1203 | * @param cfg configuration to use | 1162 | * @param cfg configuration to use |
1204 | * @param queue_size size of the per-peer message queue | 1163 | * @param queue_size size of the per-peer message queue |
1205 | * @param cls closure for the various callbacks that follow (including handlers in the handlers array) | 1164 | * @param cls closure for the various callbacks that follow (including handlers in the handlers array) |
1206 | * @param init callback to call on timeout or once we have successfully | 1165 | * @param init callback to call once we have successfully |
1207 | * connected to the core service; note that timeout is only meaningful if init is not NULL | 1166 | * connected to the core service |
1208 | * @param connects function to call on peer connect, can be NULL | 1167 | * @param connects function to call on peer connect, can be NULL |
1209 | * @param disconnects function to call on peer disconnect / timeout, can be NULL | 1168 | * @param disconnects function to call on peer disconnect / timeout, can be NULL |
1210 | * @param inbound_notify function to call for all inbound messages, can be NULL | 1169 | * @param inbound_notify function to call for all inbound messages, can be NULL |
@@ -1255,9 +1214,7 @@ GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1255 | GNUNET_assert (h->hcnt < | 1214 | GNUNET_assert (h->hcnt < |
1256 | (GNUNET_SERVER_MAX_MESSAGE_SIZE - | 1215 | (GNUNET_SERVER_MAX_MESSAGE_SIZE - |
1257 | sizeof (struct InitMessage)) / sizeof (uint16_t)); | 1216 | sizeof (struct InitMessage)) / sizeof (uint16_t)); |
1258 | #if DEBUG_CORE | ||
1259 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CORE service\n"); | 1217 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to CORE service\n"); |
1260 | #endif | ||
1261 | reconnect (h); | 1218 | reconnect (h); |
1262 | return h; | 1219 | return h; |
1263 | } | 1220 | } |
@@ -1275,9 +1232,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) | |||
1275 | { | 1232 | { |
1276 | struct ControlMessage *cm; | 1233 | struct ControlMessage *cm; |
1277 | 1234 | ||
1278 | #if DEBUG_CORE | ||
1279 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from CORE service\n"); | 1235 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from CORE service\n"); |
1280 | #endif | ||
1281 | if (handle->cth != NULL) | 1236 | if (handle->cth != NULL) |
1282 | { | 1237 | { |
1283 | GNUNET_CLIENT_notify_transmit_ready_cancel (handle->cth); | 1238 | GNUNET_CLIENT_notify_transmit_ready_cancel (handle->cth); |
@@ -1401,18 +1356,14 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, | |||
1401 | GNUNET_break (handle->queue_size != 0); | 1356 | GNUNET_break (handle->queue_size != 0); |
1402 | GNUNET_break (pr->queue_size == 1); | 1357 | GNUNET_break (pr->queue_size == 1); |
1403 | GNUNET_free (th); | 1358 | GNUNET_free (th); |
1404 | #if DEBUG_CORE | ||
1405 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1359 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1406 | "Dropping transmission request: cannot drop queue head and limit is one\n"); | 1360 | "Dropping transmission request: cannot drop queue head and limit is one\n"); |
1407 | #endif | ||
1408 | return NULL; | 1361 | return NULL; |
1409 | } | 1362 | } |
1410 | if (priority <= minp->priority) | 1363 | if (priority <= minp->priority) |
1411 | { | 1364 | { |
1412 | #if DEBUG_CORE | ||
1413 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1365 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1414 | "Dropping transmission request: priority too low\n"); | 1366 | "Dropping transmission request: priority too low\n"); |
1415 | #endif | ||
1416 | GNUNET_free (th); | 1367 | GNUNET_free (th); |
1417 | return NULL; /* priority too low */ | 1368 | return NULL; /* priority too low */ |
1418 | } | 1369 | } |
@@ -1440,9 +1391,7 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, | |||
1440 | th); | 1391 | th); |
1441 | pr->queue_size++; | 1392 | pr->queue_size++; |
1442 | /* was the request queue previously empty? */ | 1393 | /* was the request queue previously empty? */ |
1443 | #if DEBUG_CORE | ||
1444 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmission request added to queue\n"); | 1394 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmission request added to queue\n"); |
1445 | #endif | ||
1446 | if ((pr->pending_head == th) && (pr->ntr_task == GNUNET_SCHEDULER_NO_TASK) && | 1395 | if ((pr->pending_head == th) && (pr->ntr_task == GNUNET_SCHEDULER_NO_TASK) && |
1447 | (pr->next == NULL) && (pr->prev == NULL) && | 1396 | (pr->next == NULL) && (pr->prev == NULL) && |
1448 | (handle->ready_peer_head != pr)) | 1397 | (handle->ready_peer_head != pr)) |