aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-10-21 05:13:17 +0000
committerChristian Grothoff <christian@grothoff.org>2016-10-21 05:13:17 +0000
commite9a6c28aad064456c26923cf579f0ed9282afe3c (patch)
tree7940e2059e794062d8ada710c42c1da723ace115 /src/util
parentb709fa7937e671b1a5f6e941c9a2ea7c342e23f2 (diff)
downloadgnunet-e9a6c28aad064456c26923cf579f0ed9282afe3c.tar.gz
gnunet-e9a6c28aad064456c26923cf579f0ed9282afe3c.zip
use new MQ in_flight API to support cancel in new service/client implementations
Diffstat (limited to 'src/util')
-rw-r--r--src/util/client_new.c2
-rw-r--r--src/util/service_new.c11
2 files changed, 9 insertions, 4 deletions
diff --git a/src/util/client_new.c b/src/util/client_new.c
index a5bd996bb..b5c0147b3 100644
--- a/src/util/client_new.c
+++ b/src/util/client_new.c
@@ -261,7 +261,7 @@ transmit_ready (void *cls)
261 } 261 }
262 if (0 == cstate->msg_off) 262 if (0 == cstate->msg_off)
263 { 263 {
264 // FIXME: tell MQ that cancel is no longer possible! 264 GNUNET_MQ_impl_send_in_flight (cstate->mq);
265 } 265 }
266 cstate->msg_off += pos; 266 cstate->msg_off += pos;
267 if (cstate->msg_off < len) 267 if (cstate->msg_off < len)
diff --git a/src/util/service_new.c b/src/util/service_new.c
index 744adc387..8433c42bf 100644
--- a/src/util/service_new.c
+++ b/src/util/service_new.c
@@ -1974,6 +1974,10 @@ do_send (void *cls)
1974 return; 1974 return;
1975 } 1975 }
1976 } 1976 }
1977 if (0 == client->msg_pos)
1978 {
1979 GNUNET_MQ_impl_send_in_flight (client->mq);
1980 }
1977 client->msg_pos += ret; 1981 client->msg_pos += ret;
1978 if (left > ret) 1982 if (left > ret)
1979 { 1983 {
@@ -2026,9 +2030,10 @@ service_mq_cancel (struct GNUNET_MQ_Handle *mq,
2026{ 2030{
2027 struct GNUNET_SERVICE_Client *client = impl_state; 2031 struct GNUNET_SERVICE_Client *client = impl_state;
2028 2032
2029 GNUNET_assert (0); // not implemented 2033 GNUNET_assert (0 == client->msg_pos);
2030 // FIXME: stop transmission! (must be possible, otherwise 2034 client->msg = NULL;
2031 // we must have told MQ that the message was sent!) 2035 GNUNET_SCHEDULER_cancel (client->send_task);
2036 client->send_task = NULL;
2032} 2037}
2033 2038
2034 2039