gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11192 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r11192 - gnunet/src/transport
Date: Wed, 5 May 2010 13:43:29 +0200

Author: wachs
Date: 2010-05-05 13:43:29 +0200 (Wed, 05 May 2010)
New Revision: 11192

Modified:
   gnunet/src/transport/plugin_transport_http.c
   gnunet/src/transport/test_plugin_transport_http.c
Log:


Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c        2010-05-05 09:54:57 UTC 
(rev 11191)
+++ gnunet/src/transport/plugin_transport_http.c        2010-05-05 11:43:29 UTC 
(rev 11192)
@@ -318,7 +318,7 @@
   }
   if ( 0 == strcmp (MHD_HTTP_METHOD_GET, method) )
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Got GET Request with size %u 
\n",upload_data_size);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Got GET Request with size\n");
     GNUNET_STATISTICS_update( plugin->env->stats , gettext_noop("# GET 
requests"), 1, GNUNET_NO);
   }
 
@@ -423,7 +423,39 @@
   return ret;
 }
 
+/**
+ * Exit point from the plugin.
+ */
+void *
+libgnunet_plugin_transport_http_done (void *cls)
+{
+  struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
+  struct Plugin *plugin = api->cls;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Shutting down http plugin...\n");
+
+  if ( http_task != GNUNET_SCHEDULER_NO_TASK)
+  {
+    GNUNET_SCHEDULER_cancel(plugin->env->sched, http_task);
+  }
+
+  if (http_daemon != NULL)
+  {
+    MHD_stop_daemon (http_daemon);
+    http_daemon = NULL;
+  }
+
+  if ( NULL != curl_multi)
+  {
+    curl_multi_cleanup (curl_multi);
+    curl_multi = NULL;
+  }
+  /* GNUNET_SERVICE_stop (plugin->service); */
+  GNUNET_free (plugin);
+  GNUNET_free (api);
+  return NULL;
+}
+
 /**
  * Entry point for the plugin.
  */
@@ -472,7 +504,7 @@
                        _
                        ("Require valid port number for service `%s' in 
configuration!\n"),
                        "transport-http");
-      GNUNET_free (api);
+      libgnunet_plugin_transport_http_done (api);
       return NULL;
     }
   use_ipv6 = GNUNET_YES;
@@ -516,7 +548,7 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("Failed to retrieve statistics handle\n"));
-    GNUNET_free (api);
+    libgnunet_plugin_transport_http_done (api);
     return NULL;
   }
 
@@ -526,42 +558,11 @@
   if ( (NULL == http_daemon) || (NULL == curl_multi))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Initializing http plugin failed\n");
-    GNUNET_free (api);
+    libgnunet_plugin_transport_http_done (api);
     return NULL;
   }
   else
     return api;
 }
 
-
-/**
- * Exit point from the plugin.
- */
-void *
-libgnunet_plugin_transport_http_done (void *cls)
-{
-  struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
-  struct Plugin *plugin = api->cls;
-
-  if ( http_task != GNUNET_SCHEDULER_NO_TASK)
-  {
-    GNUNET_SCHEDULER_cancel(plugin->env->sched, http_task);
-  }
-
-  if (http_daemon != NULL)
-  {
-    MHD_stop_daemon (http_daemon);
-    http_daemon = NULL;
-  }
-
-  curl_multi_cleanup (curl_multi);
-  curl_multi = NULL;
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Shutting down http plugin...\n");
-  /* GNUNET_SERVICE_stop (plugin->service); */
-  GNUNET_free (plugin);
-  GNUNET_free (api);
-  return NULL;
-}
-
 /* end of plugin_transport_http.c */

Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c   2010-05-05 09:54:57 UTC 
(rev 11191)
+++ gnunet/src/transport/test_plugin_transport_http.c   2010-05-05 11:43:29 UTC 
(rev 11192)
@@ -259,6 +259,7 @@
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                   _("Failed to load http transport plugin\n"));
       fail = GNUNET_YES;
+      shutdown_clean ();
       return;
 
     }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]