diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-12 13:43:09 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-07-12 13:43:09 +0000 |
commit | 4e62ea52d994deed44a0a5cfd15faa826cd39e85 (patch) | |
tree | 95b63d77bd4868db57afe15e6c80ed0fda7b74f5 /src | |
parent | f0af6efe99502662d6d1ba6596f7d4e6e1680424 (diff) | |
download | gnunet-4e62ea52d994deed44a0a5cfd15faa826cd39e85.tar.gz gnunet-4e62ea52d994deed44a0a5cfd15faa826cd39e85.zip |
fix if plugin is loaded only in stub mode
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_common.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_common.h | 7 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 7 |
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, | |||
1771 | const void *addr, | 1771 | const void *addr, |
1772 | size_t addrlen) | 1772 | size_t addrlen) |
1773 | { | 1773 | { |
1774 | return http_common_plugin_address_to_string (cls, p->protocol, addr, addrlen); | 1774 | return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen); |
1775 | } | 1775 | } |
1776 | 1776 | ||
1777 | /** | 1777 | /** |
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, | |||
266 | const char * addr_str; | 266 | const char * addr_str; |
267 | char *res; | 267 | char *res; |
268 | 268 | ||
269 | GNUNET_assert (NULL != plugin); | ||
269 | 270 | ||
270 | if (NULL == addr) | 271 | if (NULL == addr) |
271 | return NULL; | 272 | return NULL; |
@@ -277,7 +278,6 @@ http_common_plugin_address_to_string (void *cls, char *plugin, const void *addr, | |||
277 | 278 | ||
278 | if (addr_str[ntohl(address->urlen) -1] != '\0') | 279 | if (addr_str[ntohl(address->urlen) -1] != '\0') |
279 | return NULL; | 280 | return NULL; |
280 | |||
281 | GNUNET_asprintf (&res, "%s.%u.%s", plugin, ntohl(address->options), &address[1]); | 281 | GNUNET_asprintf (&res, "%s.%u.%s", plugin, ntohl(address->options), &address[1]); |
282 | if (strlen(res) + 1 < 500) | 282 | if (strlen(res) + 1 < 500) |
283 | { | 283 | { |
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 @@ | |||
34 | #define TESTING GNUNET_NO | 34 | #define TESTING GNUNET_NO |
35 | 35 | ||
36 | #if TESTING | 36 | #if TESTING |
37 | |||
38 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) | 37 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) |
39 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) | 38 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 3) |
40 | #define CLIENT_SESSION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 7) | 39 | #define CLIENT_SESSION_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 7) |
@@ -43,6 +42,12 @@ | |||
43 | 42 | ||
44 | #else | 43 | #else |
45 | 44 | ||
45 | #if BUILD_HTTPS | ||
46 | #define PROTOCOL "https" | ||
47 | #else | ||
48 | #define PROTOCOL "http" | ||
49 | #endif | ||
50 | |||
46 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) | 51 | #define HTTP_SERVER_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) |
47 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) | 52 | #define HTTP_CLIENT_NOT_VALIDATED_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) |
48 | #define CLIENT_SESSION_TIMEOUT GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT | 53 | #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, | |||
3013 | const void *addr, | 3013 | const void *addr, |
3014 | size_t addrlen) | 3014 | size_t addrlen) |
3015 | { | 3015 | { |
3016 | return http_common_plugin_address_to_string (cls, p->protocol, addr, addrlen); | 3016 | #if BUILD_HTTPS |
3017 | return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen); | ||
3018 | #else | ||
3019 | return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, addrlen); | ||
3020 | #endif | ||
3021 | |||
3017 | } | 3022 | } |
3018 | 3023 | ||
3019 | /** | 3024 | /** |