fixes
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Sep 2011 22:08:45 +0000 (22:08 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 16 Sep 2011 22:08:45 +0000 (22:08 +0000)
src/transport/Makefile.am
src/transport/plugin_transport_http_client.c
src/transport/plugin_transport_http_new.c
src/transport/plugin_transport_http_server.c

index 4089a195a75326a4e32b3614542d196f778eca23..528a2f37e8bb9ef8ef64155a7ed4bbfc87d304c6 100644 (file)
@@ -213,7 +213,7 @@ libgnunet_plugin_transport_unix_la_LDFLAGS = \
  $(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 @@ libgnunet_plugin_transport_http_la_CPPFLAGS = \
  @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 \
index 224adb47447d5a6b0069273546f1b64e4e900f7d..715125dd0f2b9c19841cb32f7c361749d24ec0ea 100644 (file)
@@ -171,10 +171,12 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     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)
index e998636b2ee45e2f5f49c6c051d6e096f3791ccb..3cdb40dadd6b80c7281ebdaa04f95ec893b46b3c 100644 (file)
@@ -327,8 +327,6 @@ http_plugin_receive (void *cls, const struct GNUNET_PeerIdentity * peer,
 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,9 +334,7 @@ http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen)
   char *address;
   static char rbuf[INET6_ADDRSTRLEN + 13];
   uint16_t port;
-  int res;
-
-  GNUNET_assert (plugin != NULL);
+  int res = 0;
 
   if (addrlen == sizeof (struct IPv6HttpAddress))
   {
@@ -361,12 +357,17 @@ http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen)
     /* 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);
index 0c2ab54cf16bad931c8fd1ddfb2760aec238e310..3754240f1712dd51d0331dbf597b45ad4c00ad66 100644 (file)
@@ -331,7 +331,7 @@ server_access_cb (void *cls, struct MHD_Connection *mhd_connection,
   /* 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;