FIX: no curl scheduling if no curl handles are running, because this causes segfault...
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 20 Jul 2010 12:31:27 +0000 (12:31 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 20 Jul 2010 12:31:27 +0000 (12:31 +0000)
src/transport/plugin_transport_http.c

index 5cd611d1f1b5783c1434a90b94b9c1f7960f4180..43e8fd2919dfb3146f5fe38944bc7d6764285c82 100644 (file)
@@ -1439,7 +1439,7 @@ static void curl_perform (void *cls,
       handles_last_run = running;
     }
   while (mret == CURLM_CALL_MULTI_PERFORM);
-  curl_schedule(plugin);
+  if (running>0) curl_schedule(plugin);
 }
 
 
@@ -1462,6 +1462,7 @@ static int curl_schedule(void *cls )
 
   GNUNET_assert(cls !=NULL);
 
+
   /* Cancel previous scheduled task */
   if (plugin->http_curl_task !=  GNUNET_SCHEDULER_NO_TASK)
   {
@@ -2372,7 +2373,7 @@ libgnunet_plugin_transport_http_init (void *cls)
                                        plugin , &mdh_access_cb, plugin,
                                        MHD_OPTION_SOCK_ADDR, tmp,
                                        MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 32,
-                                       MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 6,
+                                       //MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 6,
                                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) timeout,
                                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (16 * 1024),
                                        MHD_OPTION_NOTIFY_COMPLETED, &mhd_termination_cb, NULL,
@@ -2390,7 +2391,7 @@ libgnunet_plugin_transport_http_init (void *cls)
                                        plugin , &mdh_access_cb, plugin,
                                        MHD_OPTION_SOCK_ADDR, (struct sockaddr_in *)plugin->bind4_address,
                                        MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 32,
-                                       MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 6,
+                                       //MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 6,
                                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) timeout,
                                        MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (16 * 1024),
                                        MHD_OPTION_NOTIFY_COMPLETED, &mhd_termination_cb, NULL,