aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-06-17 13:04:10 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-06-17 13:04:10 +0000
commit40fc9e15d7e655bf70c25c642674ce803862aee7 (patch)
treef8aed993ae8f832df8452069be066794b827ae3c /src/transport/plugin_transport_http.c
parentefa18f70d47eb8a2dd56e20c3fb0a4af6d3a03c3 (diff)
downloadgnunet-40fc9e15d7e655bf70c25c642674ce803862aee7.tar.gz
gnunet-40fc9e15d7e655bf70c25c642674ce803862aee7.zip
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r--src/transport/plugin_transport_http.c18
1 files 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
381 ses->pending_inbound_msg->buf = GNUNET_malloc(GNUNET_SERVER_MAX_MESSAGE_SIZE); 381 ses->pending_inbound_msg->buf = GNUNET_malloc(GNUNET_SERVER_MAX_MESSAGE_SIZE);
382 ses->pending_inbound_msg->len = GNUNET_SERVER_MAX_MESSAGE_SIZE; 382 ses->pending_inbound_msg->len = GNUNET_SERVER_MAX_MESSAGE_SIZE;
383 ses->pending_inbound_msg->pos = 0; 383 ses->pending_inbound_msg->pos = 0;
384
385
386 return ses; 384 return ses;
387} 385}
388 386
@@ -415,9 +413,6 @@ acceptPolicyCallback (void *cls,
415 return MHD_YES; 413 return MHD_YES;
416} 414}
417 415
418
419int serror;
420
421/** 416/**
422 * Process GET or PUT request received via MHD. For 417 * Process GET or PUT request received via MHD. For
423 * GET, queue response that will send back our pending 418 * GET, queue response that will send back our pending
@@ -968,7 +963,7 @@ static ssize_t send_select_init (struct Session* ses )
968static void send_execute (void *cls, 963static void send_execute (void *cls,
969 const struct GNUNET_SCHEDULER_TaskContext *tc) 964 const struct GNUNET_SCHEDULER_TaskContext *tc)
970{ 965{
971 966 static unsigned int handles_last_run;
972 int running; 967 int running;
973 struct CURLMsg *msg; 968 struct CURLMsg *msg;
974 CURLMcode mret; 969 CURLMcode mret;
@@ -982,7 +977,7 @@ static void send_execute (void *cls,
982 { 977 {
983 running = 0; 978 running = 0;
984 mret = curl_multi_perform (multi_handle, &running); 979 mret = curl_multi_perform (multi_handle, &running);
985 if (running == 0) 980 if (running < handles_last_run)
986 { 981 {
987 do 982 do
988 { 983 {
@@ -1054,6 +1049,7 @@ static void send_execute (void *cls,
1054 } 1049 }
1055 while ( (running > 0) ); 1050 while ( (running > 0) );
1056 } 1051 }
1052 handles_last_run = running;
1057 } 1053 }
1058 while (mret == CURLM_CALL_MULTI_PERFORM); 1054 while (mret == CURLM_CALL_MULTI_PERFORM);
1059 send_prepare(cls); 1055 send_prepare(cls);
@@ -1561,10 +1557,6 @@ libgnunet_plugin_transport_http_done (void *cls)
1561 http_daemon_v6 = NULL; 1557 http_daemon_v6 = NULL;
1562 } 1558 }
1563 1559
1564 mret = curl_multi_cleanup(multi_handle);
1565 if ( CURLM_OK != mret)
1566 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"curl multihandle clean up failed");
1567
1568 /* free all sessions */ 1560 /* free all sessions */
1569 cs = plugin->sessions; 1561 cs = plugin->sessions;
1570 1562
@@ -1597,6 +1589,10 @@ libgnunet_plugin_transport_http_done (void *cls)
1597 cs = cs_next; 1589 cs = cs_next;
1598 } 1590 }
1599 1591
1592 mret = curl_multi_cleanup(multi_handle);
1593 if ( CURLM_OK != mret)
1594 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"curl multihandle clean up failed");
1595
1600 GNUNET_free (plugin); 1596 GNUNET_free (plugin);
1601 GNUNET_free (api); 1597 GNUNET_free (api);
1602 return NULL; 1598 return NULL;