[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r17181 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r17181 - gnunet/src/transport |
Date: |
Tue, 4 Oct 2011 17:53:31 +0200 |
Author: wachs
Date: 2011-10-04 17:53:31 +0200 (Tue, 04 Oct 2011)
New Revision: 17181
Modified:
gnunet/src/transport/plugin_transport_http.c
gnunet/src/transport/plugin_transport_http.h
Log:
implemented: client-only mode
Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c 2011-10-04 15:34:58 UTC
(rev 17180)
+++ gnunet/src/transport/plugin_transport_http.c 2011-10-04 15:53:31 UTC
(rev 17181)
@@ -581,6 +581,9 @@
struct Session *next = NULL;
struct Session *s = plugin->head;
+ GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+ "Transport tells me to disconnect `%s'\n",
+ GNUNET_i2s (target));
while (s != NULL)
{
next = s->next;
@@ -907,6 +910,13 @@
}
plugin->port = port;
+ plugin->client_only = GNUNET_NO;
+ if (plugin->port == 0)
+ {
+ GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
+ _("Port 0, client only mode\n"));
+ plugin->client_only = GNUNET_YES;
+ }
char * bind4_address = NULL;
if ((plugin->ipv4 == GNUNET_YES) && (GNUNET_YES ==
@@ -1024,19 +1034,21 @@
}
/* Start server */
- res = server_start (plugin);
- if (res == GNUNET_SYSERR)
+ if (plugin->client_only == GNUNET_NO)
{
- server_stop (plugin);
- client_stop (plugin);
+ res = server_start (plugin);
+ if (res == GNUNET_SYSERR)
+ {
+ server_stop (plugin);
+ client_stop (plugin);
- GNUNET_free_non_null (plugin->server_addr_v4);
- GNUNET_free_non_null (plugin->server_addr_v6);
- GNUNET_free (plugin);
- GNUNET_free (api);
- return NULL;
+ GNUNET_free_non_null (plugin->server_addr_v4);
+ GNUNET_free_non_null (plugin->server_addr_v6);
+ GNUNET_free (plugin);
+ GNUNET_free (api);
+ return NULL;
+ }
}
-
/* Report addresses to transport service */
start_report_addresses (plugin);
Modified: gnunet/src/transport/plugin_transport_http.h
===================================================================
--- gnunet/src/transport/plugin_transport_http.h 2011-10-04 15:34:58 UTC
(rev 17180)
+++ gnunet/src/transport/plugin_transport_http.h 2011-10-04 15:53:31 UTC
(rev 17181)
@@ -42,9 +42,9 @@
#include <curl/curl.h>
-#define DEBUG_HTTP GNUNET_YES
-#define VERBOSE_SERVER GNUNET_YES
-#define VERBOSE_CLIENT GNUNET_YES
+#define DEBUG_HTTP GNUNET_NO
+#define VERBOSE_SERVER GNUNET_NO
+#define VERBOSE_CLIENT GNUNET_NO
#define VERBOSE_CURL GNUNET_EXTRA_LOGGING
#if BUILD_HTTPS
@@ -143,6 +143,12 @@
int ipv6;
/**
+ * Does plugin just use outbound connections and not accept inbound?
+ */
+
+ int client_only;
+
+ /**
* Port used
*/
uint16_t port;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r17181 - gnunet/src/transport,
gnunet <=