[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r16915 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r16915 - gnunet/src/transport |
Date: |
Sat, 17 Sep 2011 00:08:45 +0200 |
Author: wachs
Date: 2011-09-17 00:08:45 +0200 (Sat, 17 Sep 2011)
New Revision: 16915
Modified:
gnunet/src/transport/Makefile.am
gnunet/src/transport/plugin_transport_http_client.c
gnunet/src/transport/plugin_transport_http_new.c
gnunet/src/transport/plugin_transport_http_server.c
Log:
fixes
Modified: gnunet/src/transport/Makefile.am
===================================================================
--- gnunet/src/transport/Makefile.am 2011-09-16 21:22:48 UTC (rev 16914)
+++ gnunet/src/transport/Makefile.am 2011-09-16 22:08:45 UTC (rev 16915)
@@ -213,7 +213,7 @@
$(GN_PLUGIN_LDFLAGS)
libgnunet_plugin_transport_http_la_SOURCES = \
- plugin_transport_http.c
+ plugin_transport_http_new.c plugin_transport_http_client.c
plugin_transport_http_server.c
libgnunet_plugin_transport_http_la_LIBADD = \
$(top_builddir)/src/hello/libgnunethello.la \
$(top_builddir)/src/statistics/libgnunetstatistics.la \
@@ -230,7 +230,7 @@
@LIBCURL_CPPFLAGS@
libgnunet_plugin_transport_https_la_SOURCES = \
- plugin_transport_http.c
+ plugin_transport_http_new.c plugin_transport_http_client.c
plugin_transport_http_server.c
libgnunet_plugin_transport_https_la_LIBADD = \
$(top_builddir)/src/hello/libgnunethello.la \
$(top_builddir)/src/statistics/libgnunetstatistics.la \
Modified: gnunet/src/transport/plugin_transport_http_client.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_client.c 2011-09-16 21:22:48 UTC
(rev 16914)
+++ gnunet/src/transport/plugin_transport_http_client.c 2011-09-16 22:08:45 UTC
(rev 16915)
@@ -171,10 +171,12 @@
while ((msg = curl_multi_info_read(plugin->client_mh, &msgs_left)))
{
CURL *easy_h = msg->easy_handle;
- struct Session *s;
+ struct Session *s = NULL;
+ char * d = (char *) s;
GNUNET_assert (easy_h != NULL);
- GNUNET_assert (CURLE_OK == curl_easy_getinfo(easy_h, CURLINFO_PRIVATE,
&s));
+ GNUNET_assert (CURLE_OK == curl_easy_getinfo(easy_h, CURLINFO_PRIVATE,
&d));
+ s = (struct Session *) d;
GNUNET_assert (s != NULL);
if (msg->msg == CURLMSG_DONE)
Modified: gnunet/src/transport/plugin_transport_http_new.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_new.c 2011-09-16 21:22:48 UTC
(rev 16914)
+++ gnunet/src/transport/plugin_transport_http_new.c 2011-09-16 22:08:45 UTC
(rev 16915)
@@ -327,8 +327,6 @@
const char *
http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen)
{
- struct Plugin *plugin = cls;
-
const struct IPv4HttpAddress *t4;
const struct IPv6HttpAddress *t6;
struct sockaddr_in a4;
@@ -336,10 +334,8 @@
char *address;
static char rbuf[INET6_ADDRSTRLEN + 13];
uint16_t port;
- int res;
+ int res = 0;
- GNUNET_assert (plugin != NULL);
-
if (addrlen == sizeof (struct IPv6HttpAddress))
{
address = GNUNET_malloc (INET6_ADDRSTRLEN);
@@ -361,12 +357,17 @@
/* invalid address */
return NULL;
}
+#if !BUILD_HTTPS
+ char * protocol = "http";
+#else
+ char * protocol = "https";
+#endif
GNUNET_assert (strlen (address) + 7 < (INET6_ADDRSTRLEN + 13));
- if (addrlen == sizeof (struct IPv6HttpAddress))
- res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://[%s]:%u/",
plugin->protocol, address, port);
+ if (addrlen == sizeof (struct IPv6HttpAddress))
+ res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://[%s]:%u/", protocol,
address, port);
else if (addrlen == sizeof (struct IPv4HttpAddress))
- res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://%s:%u/",
plugin->protocol, address, port);
+ res = GNUNET_snprintf (rbuf, sizeof (rbuf), "%s://%s:%u/", protocol,
address, port);
GNUNET_free (address);
GNUNET_assert (res != 0);
Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2011-09-16 21:22:48 UTC
(rev 16914)
+++ gnunet/src/transport/plugin_transport_http_server.c 2011-09-16 22:08:45 UTC
(rev 16915)
@@ -331,7 +331,7 @@
/* new connection */
if (sc == NULL)
{
- uint32_t tag;
+ uint32_t tag = 0;
const union MHD_ConnectionInfo *conn_info;
size_t addrlen;
struct GNUNET_PeerIdentity target;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r16915 - gnunet/src/transport,
gnunet <=