aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-29 18:53:57 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-29 18:53:57 +0000
commit81ae4871c8451e1eb3a5b270c30f4833d35845c2 (patch)
treed3fad208dd1a602ebd3b8d27576af6b4c58ab3a0 /src
parent91d4e478b4753b6dc9c3eb9d9eee3df22b120f69 (diff)
downloadgnunet-81ae4871c8451e1eb3a5b270c30f4833d35845c2.tar.gz
gnunet-81ae4871c8451e1eb3a5b270c30f4833d35845c2.zip
hacky fix for cadet issues
Diffstat (limited to 'src')
-rw-r--r--src/core/core_api.c22
-rw-r--r--src/core/gnunet-service-core_clients.c7
2 files changed, 23 insertions, 6 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index 4c55d0e5f..061a929e0 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -411,7 +411,7 @@ handle_init_reply (void *cls,
411 */ 411 */
412static void 412static void
413handle_connect_notify (void *cls, 413handle_connect_notify (void *cls,
414 const struct ConnectNotifyMessage * cnm) 414 const struct ConnectNotifyMessage *cnm)
415{ 415{
416 struct GNUNET_CORE_Handle *h = cls; 416 struct GNUNET_CORE_Handle *h = cls;
417 struct PeerRecord *pr; 417 struct PeerRecord *pr;
@@ -713,6 +713,18 @@ handle_send_ready (void *cls,
713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
714 "Calling get_message with buffer of %u bytes\n", 714 "Calling get_message with buffer of %u bytes\n",
715 (unsigned int) th->msize); 715 (unsigned int) th->msize);
716 /* FIXME: this is ugly and a bit brutal, but "get_message"
717 may call GNUNET_CORE_notify_transmit_ready() which
718 may call GNUNET_MQ_send() as well, and we MUST get this
719 message out before the next SEND_REQUEST. So we queue
720 it (even though incomplete) and then---relying on MQ being
721 nice and not actually touching 'env' until much later---
722 fill it afterwards. This is horrible style, and once
723 the core_api abandons GNUNET_CORE_notify_transmit_ready
724 in favor of an MQ-style API, this hack should no longer
725 be required */
726 GNUNET_MQ_send (h->mq,
727 env);
716 ret = th->get_message (th->get_message_cls, 728 ret = th->get_message (th->get_message_cls,
717 th->msize, 729 th->msize,
718 &sm[1]); 730 &sm[1]);
@@ -737,8 +749,6 @@ handle_send_ready (void *cls,
737 GNUNET_STRINGS_relative_time_to_string (delay, 749 GNUNET_STRINGS_relative_time_to_string (delay,
738 GNUNET_YES), 750 GNUNET_YES),
739 (th->cork) ? " (corked)" : ""); 751 (th->cork) ? " (corked)" : "");
740 GNUNET_MQ_send (h->mq,
741 env);
742} 752}
743 753
744 754
@@ -838,13 +848,13 @@ reconnect (struct GNUNET_CORE_Handle *h)
838 * @param inbound_notify function to call for all inbound messages, can be NULL 848 * @param inbound_notify function to call for all inbound messages, can be NULL
839 * @param inbound_hdr_only set to #GNUNET_YES if inbound_notify will only read the 849 * @param inbound_hdr_only set to #GNUNET_YES if inbound_notify will only read the
840 * GNUNET_MessageHeader and hence we do not need to give it the full message; 850 * GNUNET_MessageHeader and hence we do not need to give it the full message;
841 * can be used to improve efficiency, ignored if @a inbound_notify is NULLL 851 * can be used to improve efficiency, ignored if @a inbound_notify is NULL
842 * @param outbound_notify function to call for all outbound messages, can be NULL 852 * @param outbound_notify function to call for all outbound messages, can be NULL
843 * @param outbound_hdr_only set to #GNUNET_YES if outbound_notify will only read the 853 * @param outbound_hdr_only set to #GNUNET_YES if outbound_notify will only read the
844 * GNUNET_MessageHeader and hence we do not need to give it the full message 854 * GNUNET_MessageHeader and hence we do not need to give it the full message
845 * can be used to improve efficiency, ignored if @a outbound_notify is NULLL 855 * can be used to improve efficiency, ignored if @a outbound_notify is NULL
846 * @param handlers callbacks for messages we care about, NULL-terminated 856 * @param handlers callbacks for messages we care about, NULL-terminated
847 * @return handle to the core service (only useful for disconnect until 'init' is called); 857 * @return handle to the core service (only useful for disconnect until @a init is called);
848 * NULL on error (in this case, init is never called) 858 * NULL on error (in this case, init is never called)
849 */ 859 */
850struct GNUNET_CORE_Handle * 860struct GNUNET_CORE_Handle *
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c
index c90b674e0..c2198848f 100644
--- a/src/core/gnunet-service-core_clients.c
+++ b/src/core/gnunet-service-core_clients.c
@@ -401,7 +401,14 @@ handle_client_send_request (void *cls,
401 { 401 {
402 /* dequeue and recycle memory from pending request, there can only 402 /* dequeue and recycle memory from pending request, there can only
403 be at most one per client and peer */ 403 be at most one per client and peer */
404 GNUNET_STATISTICS_update (GSC_stats,
405 gettext_noop
406 ("# dequeuing CAR (duplicate request)"), 1,
407 GNUNET_NO);
404 GSC_SESSIONS_dequeue_request (car); 408 GSC_SESSIONS_dequeue_request (car);
409 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
410 "Transmission request to `%s' was a duplicate!\n",
411 GNUNET_i2s (&req->peer));
405 } 412 }
406 car->target = req->peer; 413 car->target = req->peer;
407 car->received_time = GNUNET_TIME_absolute_get (); 414 car->received_time = GNUNET_TIME_absolute_get ();