diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-09-16 22:08:45 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-09-16 22:08:45 +0000 |
commit | 2b9c6d7aa188d9666104d52d5ffb3338521fd27e (patch) | |
tree | a0a9c402b61c8e6a57533e49e4ed9c834bc573b9 /src | |
parent | b5018b4a304d7e39d3bb254977437a2d08f234d4 (diff) | |
download | gnunet-2b9c6d7aa188d9666104d52d5ffb3338521fd27e.tar.gz gnunet-2b9c6d7aa188d9666104d52d5ffb3338521fd27e.zip |
fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/Makefile.am | 4 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_client.c | 6 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_new.c | 17 | ||||
-rw-r--r-- | src/transport/plugin_transport_http_server.c | 2 |
4 files changed, 16 insertions, 13 deletions
diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 4089a195a..528a2f37e 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am | |||
@@ -213,7 +213,7 @@ libgnunet_plugin_transport_unix_la_LDFLAGS = \ | |||
213 | $(GN_PLUGIN_LDFLAGS) | 213 | $(GN_PLUGIN_LDFLAGS) |
214 | 214 | ||
215 | libgnunet_plugin_transport_http_la_SOURCES = \ | 215 | libgnunet_plugin_transport_http_la_SOURCES = \ |
216 | plugin_transport_http.c | 216 | plugin_transport_http_new.c plugin_transport_http_client.c plugin_transport_http_server.c |
217 | libgnunet_plugin_transport_http_la_LIBADD = \ | 217 | libgnunet_plugin_transport_http_la_LIBADD = \ |
218 | $(top_builddir)/src/hello/libgnunethello.la \ | 218 | $(top_builddir)/src/hello/libgnunethello.la \ |
219 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 219 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
@@ -230,7 +230,7 @@ libgnunet_plugin_transport_http_la_CPPFLAGS = \ | |||
230 | @LIBCURL_CPPFLAGS@ | 230 | @LIBCURL_CPPFLAGS@ |
231 | 231 | ||
232 | libgnunet_plugin_transport_https_la_SOURCES = \ | 232 | libgnunet_plugin_transport_https_la_SOURCES = \ |
233 | plugin_transport_http.c | 233 | plugin_transport_http_new.c plugin_transport_http_client.c plugin_transport_http_server.c |
234 | libgnunet_plugin_transport_https_la_LIBADD = \ | 234 | libgnunet_plugin_transport_https_la_LIBADD = \ |
235 | $(top_builddir)/src/hello/libgnunethello.la \ | 235 | $(top_builddir)/src/hello/libgnunethello.la \ |
236 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ | 236 | $(top_builddir)/src/statistics/libgnunetstatistics.la \ |
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index 224adb474..715125dd0 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c | |||
@@ -171,10 +171,12 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
171 | while ((msg = curl_multi_info_read(plugin->client_mh, &msgs_left))) | 171 | while ((msg = curl_multi_info_read(plugin->client_mh, &msgs_left))) |
172 | { | 172 | { |
173 | CURL *easy_h = msg->easy_handle; | 173 | CURL *easy_h = msg->easy_handle; |
174 | struct Session *s; | 174 | struct Session *s = NULL; |
175 | char * d = (char *) s; | ||
175 | GNUNET_assert (easy_h != NULL); | 176 | GNUNET_assert (easy_h != NULL); |
176 | 177 | ||
177 | GNUNET_assert (CURLE_OK == curl_easy_getinfo(easy_h, CURLINFO_PRIVATE, &s)); | 178 | GNUNET_assert (CURLE_OK == curl_easy_getinfo(easy_h, CURLINFO_PRIVATE, &d)); |
179 | s = (struct Session *) d; | ||
178 | GNUNET_assert (s != NULL); | 180 | GNUNET_assert (s != NULL); |
179 | 181 | ||
180 | if (msg->msg == CURLMSG_DONE) | 182 | if (msg->msg == CURLMSG_DONE) |
diff --git a/src/transport/plugin_transport_http_new.c b/src/transport/plugin_transport_http_new.c index e998636b2..3cdb40dad 100644 --- a/src/transport/plugin_transport_http_new.c +++ b/src/transport/plugin_transport_http_new.c | |||
@@ -327,8 +327,6 @@ http_plugin_receive (void *cls, const struct GNUNET_PeerIdentity * peer, | |||
327 | const char * | 327 | const char * |
328 | http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | 328 | http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) |
329 | { | 329 | { |
330 | struct Plugin *plugin = cls; | ||
331 | |||
332 | const struct IPv4HttpAddress *t4; | 330 | const struct IPv4HttpAddress *t4; |
333 | const struct IPv6HttpAddress *t6; | 331 | const struct IPv6HttpAddress *t6; |
334 | struct sockaddr_in a4; | 332 | struct sockaddr_in a4; |
@@ -336,9 +334,7 @@ http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | |||
336 | char *address; | 334 | char *address; |
337 | static char rbuf[INET6_ADDRSTRLEN + 13]; | 335 | static char rbuf[INET6_ADDRSTRLEN + 13]; |
338 | uint16_t port; | 336 | uint16_t port; |
339 | int res; | 337 | int res = 0; |
340 | |||
341 | GNUNET_assert (plugin != NULL); | ||
342 | 338 | ||
343 | if (addrlen == sizeof (struct IPv6HttpAddress)) | 339 | if (addrlen == sizeof (struct IPv6HttpAddress)) |
344 | { | 340 | { |
@@ -361,12 +357,17 @@ http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen) | |||
361 | /* invalid address */ | 357 | /* invalid address */ |
362 | return NULL; | 358 | return NULL; |
363 | } | 359 | } |
360 | #if !BUILD_HTTPS | ||
361 | char * protocol = "http"; | ||
362 | #else | ||
363 | char * protocol = "https"; | ||
364 | #endif | ||
364 | 365 | ||
365 | GNUNET_assert (strlen (address) + 7 < (INET6_ADDRSTRLEN + 13)); | 366 | GNUNET_assert (strlen (address) + 7 < (INET6_ADDRSTRLEN + 13)); |
366 | if (addrlen == sizeof (struct IPv6HttpAddress)) | 367 | if (addrlen == sizeof (struct IPv6HttpAddress)) |
367 | res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://[%s]:%u/", plugin->protocol, address, port); | 368 | res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://[%s]:%u/", protocol, address, port); |
368 | else if (addrlen == sizeof (struct IPv4HttpAddress)) | 369 | else if (addrlen == sizeof (struct IPv4HttpAddress)) |
369 | res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://%s:%u/", plugin->protocol, address, port); | 370 | res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://%s:%u/", protocol, address, port); |
370 | 371 | ||
371 | GNUNET_free (address); | 372 | GNUNET_free (address); |
372 | GNUNET_assert (res != 0); | 373 | GNUNET_assert (res != 0); |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 0c2ab54cf..3754240f1 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -331,7 +331,7 @@ server_access_cb (void *cls, struct MHD_Connection *mhd_connection, | |||
331 | /* new connection */ | 331 | /* new connection */ |
332 | if (sc == NULL) | 332 | if (sc == NULL) |
333 | { | 333 | { |
334 | uint32_t tag; | 334 | uint32_t tag = 0; |
335 | const union MHD_ConnectionInfo *conn_info; | 335 | const union MHD_ConnectionInfo *conn_info; |
336 | size_t addrlen; | 336 | size_t addrlen; |
337 | struct GNUNET_PeerIdentity target; | 337 | struct GNUNET_PeerIdentity target; |