From 40fc9e15d7e655bf70c25c642674ce803862aee7 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 17 Jun 2010 13:04:10 +0000 Subject: [PATCH] --- src/transport/plugin_transport_http.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index f92fcb706..86cc30477 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -381,8 +381,6 @@ static struct Session * create_session (struct sockaddr_in *addr_in, struct sock ses->pending_inbound_msg->buf = GNUNET_malloc(GNUNET_SERVER_MAX_MESSAGE_SIZE); ses->pending_inbound_msg->len = GNUNET_SERVER_MAX_MESSAGE_SIZE; ses->pending_inbound_msg->pos = 0; - - return ses; } @@ -415,9 +413,6 @@ acceptPolicyCallback (void *cls, return MHD_YES; } - -int serror; - /** * Process GET or PUT request received via MHD. For * GET, queue response that will send back our pending @@ -968,7 +963,7 @@ static ssize_t send_select_init (struct Session* ses ) static void send_execute (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - + static unsigned int handles_last_run; int running; struct CURLMsg *msg; CURLMcode mret; @@ -982,7 +977,7 @@ static void send_execute (void *cls, { running = 0; mret = curl_multi_perform (multi_handle, &running); - if (running == 0) + if (running < handles_last_run) { do { @@ -1054,6 +1049,7 @@ static void send_execute (void *cls, } while ( (running > 0) ); } + handles_last_run = running; } while (mret == CURLM_CALL_MULTI_PERFORM); send_prepare(cls); @@ -1561,10 +1557,6 @@ libgnunet_plugin_transport_http_done (void *cls) http_daemon_v6 = NULL; } - mret = curl_multi_cleanup(multi_handle); - if ( CURLM_OK != mret) - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"curl multihandle clean up failed"); - /* free all sessions */ cs = plugin->sessions; @@ -1597,6 +1589,10 @@ libgnunet_plugin_transport_http_done (void *cls) cs = cs_next; } + mret = curl_multi_cleanup(multi_handle); + if ( CURLM_OK != mret) + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"curl multihandle clean up failed"); + GNUNET_free (plugin); GNUNET_free (api); return NULL; -- 2.25.1