From 8b7ba67e4e201aaa44ef60b51396e29dc379d1fd Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 10 May 2012 22:24:00 +0000 Subject: [PATCH] -eliminating cont-calls check, hard to count exactly with frag --- src/transport/plugin_transport_http_server.c | 6 ++---- src/transport/plugin_transport_udp.c | 13 ------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 7e09245f1..e5e4690d7 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -598,13 +598,11 @@ server_access_cb (void *cls, struct MHD_Connection *mhd_connection, const char *upload_data, size_t * upload_data_size, void **httpSessionCache) { - struct Plugin *plugin = cls; struct ServerConnection *sc = *httpSessionCache; - struct Session *s = NULL; - - int res = MHD_YES; + struct Session *s; struct MHD_Response *response; + int res = MHD_YES; GNUNET_assert (cls != NULL); /* new connection */ diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 718ef2131..b14e14357 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -293,7 +293,6 @@ struct UDP_ACK_Message }; -static int cont_calls; /** * We have been notified that our readset has something to read. We don't @@ -550,8 +549,6 @@ call_continuation (struct UDPMessageWrapper *udpw, int result) if (NULL != udpw->cont) { udpw->cont (udpw->cont_cls, &udpw->session->target,result); - GNUNET_assert (cont_calls > 0); - cont_calls --; } } @@ -703,7 +700,6 @@ disconnect_and_free_it (void *cls, const GNUNET_HashCode * key, void *value) if (NULL != s->frag_ctx->cont) { s->frag_ctx->cont (s->frag_ctx->cont_cls, &s->target, GNUNET_SYSERR); - cont_calls --; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling continuation for fragemented message to `%s' with result SYSERR\n", GNUNET_i2s (&s->target)); @@ -1012,7 +1008,6 @@ enqueue_fragment (void *cls, const struct GNUNET_MessageHeader *msg) udpw->udp = (char *) &udpw[1]; udpw->msg_size = msg_len; - cont_calls++; udpw->cont = &send_next_fragment; udpw->cont_cls = udpw; udpw->timeout = frag_ctx->timeout; @@ -1144,10 +1139,6 @@ udp_plugin_send (void *cls, udpw->cont = cont; udpw->cont_cls = cont_cls; udpw->frag_ctx = NULL; - if (NULL != udpw->cont) - { - cont_calls ++; - } memcpy (udpw->udp, udp, sizeof (struct UDPMessage)); memcpy (&udpw->udp[sizeof (struct UDPMessage)], msgbuf, msgbuf_size); @@ -1176,8 +1167,6 @@ udp_plugin_send (void *cls, &enqueue_fragment, frag_ctx); - if (NULL != frag_ctx->cont) - cont_calls ++; s->frag_ctx = frag_ctx; } @@ -1627,7 +1616,6 @@ static void read_process_ack (struct Plugin *plugin, "Calling continuation for fragmented message to `%s' with result %s\n", GNUNET_i2s (&s->target), "OK"); s->frag_ctx->cont (s->frag_ctx->cont_cls, &udp_ack->sender, GNUNET_OK); - cont_calls --; } GNUNET_free (s->frag_ctx); @@ -2420,7 +2408,6 @@ libgnunet_plugin_transport_udp_done (void *cls) plugin->nat = NULL; GNUNET_free (plugin); GNUNET_free (api); - GNUNET_assert (0 == cont_calls); return NULL; } -- 2.25.1