gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r23602 - gnunet/src/transport
Date: Tue, 4 Sep 2012 11:58:15 +0200

Author: wachs
Date: 2012-09-04 11:58:15 +0200 (Tue, 04 Sep 2012)
New Revision: 23602

Modified:
   gnunet/src/transport/plugin_transport_http_server.c
   gnunet/src/transport/test_plugin_transport.c
Log:
- fix


Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2012-09-04 08:48:29 UTC 
(rev 23601)
+++ gnunet/src/transport/plugin_transport_http_server.c 2012-09-04 09:58:15 UTC 
(rev 23602)
@@ -1924,6 +1924,18 @@
 void
 server_stop (struct HTTP_Server_Plugin *plugin)
 {
+  if (plugin->server_v4 != NULL)
+  {
+    MHD_stop_daemon (plugin->server_v4);
+    plugin->server_v4 = NULL;
+  }
+  if ( plugin->server_v6 != NULL)
+  {
+    MHD_stop_daemon (plugin->server_v6);
+    plugin->server_v6 = NULL;
+  }
+
+
   if (plugin->server_v4_task != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
@@ -1935,18 +1947,6 @@
     GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
     plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK;
   }
-
-  if (plugin->server_v4 != NULL)
-  {
-    MHD_stop_daemon (plugin->server_v4);
-    plugin->server_v4 = NULL;
-  }
-  if ( plugin->server_v6 != NULL)
-  {
-    MHD_stop_daemon (plugin->server_v6);
-    plugin->server_v6 = NULL;
-  }
-
   p = NULL;
 
 #if BUILD_HTTPS

Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c        2012-09-04 08:48:29 UTC 
(rev 23601)
+++ gnunet/src/transport/test_plugin_transport.c        2012-09-04 09:58:15 UTC 
(rev 23602)
@@ -287,7 +287,29 @@
   return GNUNET_TIME_relative_get_zero_();
 }
 
+/**
+ * Take the given address and append it to the set of results sent back to
+ * the client.
+ *
+ * @param cls the transmission context used ('struct 
GNUNET_SERVER_TransmitContext*')
+ * @param buf text to transmit
+ */
+static void
+address_pretty_printer_cb (void *cls, const char *buf)
+{
+  if (NULL != buf)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                "Pretty address : `%s'\n", buf);
+  }
+  else
+  {
+      GNUNET_break (0);
+      end_badly_now ();
+  }
+}
 
+
 static void
 env_notify_address (void *cls,
                     int add_remove,
@@ -312,6 +334,11 @@
       memcpy (w->addr, addr, addrlen);
       GNUNET_CONTAINER_DLL_insert(head, tail, w);
 
+      api->address_pretty_printer (api->cls, plugin, addr, addrlen,
+                                    GNUNET_YES, GNUNET_TIME_UNIT_MINUTES,
+                                    &address_pretty_printer_cb,
+                                    w);
+
       a2s = strdup (api->address_to_string (api, w->addr, w->addrlen));
       if (NULL == a2s)
       {




reply via email to

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