summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2013-07-12 13:43:09 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2013-07-12 13:43:09 +0000
commit4e62ea52d994deed44a0a5cfd15faa826cd39e85 (patch)
tree95b63d77bd4868db57afe15e6c80ed0fda7b74f5 /src
parentf0af6efe99502662d6d1ba6596f7d4e6e1680424 (diff)
fix if plugin is loaded only in stub mode
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_http_client.c2
-rw-r--r--src/transport/plugin_transport_http_common.c2
-rw-r--r--src/transport/plugin_transport_http_common.h7
-rw-r--r--src/transport/plugin_transport_http_server.c7
4 files changed, 14 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 466d05acd..8f814b590 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -1771,7 +1771,7 @@ const char *http_plugin_address_to_string (void *cls,
const void *addr,
size_t addrlen)
{
- return http_common_plugin_address_to_string (cls, p->protocol, addr, addrlen);
+ return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen);
}
/**
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c
index 912ba93d3..887aa6981 100644
--- a/src/transport/plugin_transport_http_common.c
+++ b/src/transport/plugin_transport_http_common.c
@@ -266,6 +266,7 @@ http_common_plugin_address_to_string (void *cls, char *plugin, const void *addr,
const char * addr_str;
char *res;
+ GNUNET_assert (NULL != plugin);
if (NULL == addr)
return NULL;
@@ -277,7 +278,6 @@ http_common_plugin_address_to_string (void *cls, char *plugin, const void *addr,
if (addr_str[ntohl(address->urlen) -1] != '\0')
return NULL;
-
GNUNET_asprintf (&res, "%s.%u.%s", plugin, ntohl(address->options), &address[1]);
if (strlen(res) + 1 < 500)
{
diff --git a/src/transport/plugin_transport_http_common.h b/src/transport/plugin_transport_http_common.h
index ae37f605a..51473d73a 100644
--- a/src/transport/plugin_transport_http_common.h
+++ b/src/transport/plugin_transport_http_common.h
@@ -34,7 +34,6 @@
#define TESTING GNUNET_NO
#if TESTING
-
#define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
#define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3)
#define CLIENT_SESSION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 7)
@@ -43,6 +42,12 @@
#else
+#if BUILD_HTTPS
+#define PROTOCOL "https"
+#else
+#define PROTOCOL "http"
+#endif
+
#define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
#define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
#define CLIENT_SESSION_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 56cd12fe8..10ba80a19 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -3013,7 +3013,12 @@ const char *http_plugin_address_to_string (void *cls,
const void *addr,
size_t addrlen)
{
- return http_common_plugin_address_to_string (cls, p->protocol, addr, addrlen);
+#if BUILD_HTTPS
+ return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen);
+#else
+ return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen);
+#endif
+
}
/**