aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_http.c34
-rw-r--r--src/transport/plugin_transport_http.h12
2 files changed, 32 insertions, 14 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c
index bafc7f15b..3c61cf242 100644
--- a/src/transport/plugin_transport_http.c
+++ b/src/transport/plugin_transport_http.c
@@ -581,6 +581,9 @@ http_plugin_disconnect (void *cls, const struct GNUNET_PeerIdentity *target)
581 struct Session *next = NULL; 581 struct Session *next = NULL;
582 struct Session *s = plugin->head; 582 struct Session *s = plugin->head;
583 583
584 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
585 "Transport tells me to disconnect `%s'\n",
586 GNUNET_i2s (target));
584 while (s != NULL) 587 while (s != NULL)
585 { 588 {
586 next = s->next; 589 next = s->next;
@@ -907,6 +910,13 @@ configure_plugin (struct Plugin *plugin)
907 } 910 }
908 plugin->port = port; 911 plugin->port = port;
909 912
913 plugin->client_only = GNUNET_NO;
914 if (plugin->port == 0)
915 {
916 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
917 _("Port 0, client only mode\n"));
918 plugin->client_only = GNUNET_YES;
919 }
910 920
911 char * bind4_address = NULL; 921 char * bind4_address = NULL;
912 if ((plugin->ipv4 == GNUNET_YES) && (GNUNET_YES == 922 if ((plugin->ipv4 == GNUNET_YES) && (GNUNET_YES ==
@@ -1024,19 +1034,21 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls)
1024 } 1034 }
1025 1035
1026 /* Start server */ 1036 /* Start server */
1027 res = server_start (plugin); 1037 if (plugin->client_only == GNUNET_NO)
1028 if (res == GNUNET_SYSERR)
1029 { 1038 {
1030 server_stop (plugin); 1039 res = server_start (plugin);
1031 client_stop (plugin); 1040 if (res == GNUNET_SYSERR)
1032 1041 {
1033 GNUNET_free_non_null (plugin->server_addr_v4); 1042 server_stop (plugin);
1034 GNUNET_free_non_null (plugin->server_addr_v6); 1043 client_stop (plugin);
1035 GNUNET_free (plugin); 1044
1036 GNUNET_free (api); 1045 GNUNET_free_non_null (plugin->server_addr_v4);
1037 return NULL; 1046 GNUNET_free_non_null (plugin->server_addr_v6);
1047 GNUNET_free (plugin);
1048 GNUNET_free (api);
1049 return NULL;
1050 }
1038 } 1051 }
1039
1040 /* Report addresses to transport service */ 1052 /* Report addresses to transport service */
1041 start_report_addresses (plugin); 1053 start_report_addresses (plugin);
1042 1054
diff --git a/src/transport/plugin_transport_http.h b/src/transport/plugin_transport_http.h
index 9b057d1b0..e62c980b4 100644
--- a/src/transport/plugin_transport_http.h
+++ b/src/transport/plugin_transport_http.h
@@ -42,9 +42,9 @@
42#include <curl/curl.h> 42#include <curl/curl.h>
43 43
44 44
45#define DEBUG_HTTP GNUNET_YES 45#define DEBUG_HTTP GNUNET_NO
46#define VERBOSE_SERVER GNUNET_YES 46#define VERBOSE_SERVER GNUNET_NO
47#define VERBOSE_CLIENT GNUNET_YES 47#define VERBOSE_CLIENT GNUNET_NO
48#define VERBOSE_CURL GNUNET_EXTRA_LOGGING 48#define VERBOSE_CURL GNUNET_EXTRA_LOGGING
49 49
50#if BUILD_HTTPS 50#if BUILD_HTTPS
@@ -143,6 +143,12 @@ struct Plugin
143 int ipv6; 143 int ipv6;
144 144
145 /** 145 /**
146 * Does plugin just use outbound connections and not accept inbound?
147 */
148
149 int client_only;
150
151 /**
146 * Port used 152 * Port used
147 */ 153 */
148 uint16_t port; 154 uint16_t port;