remove output
[oweals/gnunet.git] / src / transport / plugin_transport_http_client.c
index 365a3c2bd27cf32def4d630bb1e77bcad96b18bf..75daeab71da289a63787799ff21aeee9c4e846db 100644 (file)
  */
 
 #if BUILD_HTTPS
+#define PLUGIN_NAME "https_client"
 #define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_https_client_init
 #define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_https_client_done
 #else
+#define PLUGIN_NAME "http_client"
 #define LIBGNUNET_PLUGIN_TRANSPORT_INIT libgnunet_plugin_transport_http_client_init
 #define LIBGNUNET_PLUGIN_TRANSPORT_DONE libgnunet_plugin_transport_http_client_done
 #endif
@@ -920,7 +922,6 @@ client_receive_mst_cb (void *cls, void *client,
   atsi.type = htonl (GNUNET_ATS_NETWORK_TYPE);
   atsi.value = s->ats_address_network_type;
   GNUNET_break (s->ats_address_network_type != ntohl (GNUNET_ATS_NET_UNSPECIFIED));
-
   delay = s->plugin->env->receive (plugin->env->cls, &s->target, message,
                                    s, (const char *) s->addr, s->addrlen);
 
@@ -1437,6 +1438,7 @@ client_connect (struct Session *s)
   return res;
 }
 
+
 /**
  * Function obtain the network type for a session
  *
@@ -1445,11 +1447,11 @@ client_connect (struct Session *s)
  * @return the network type in HBO or GNUNET_SYSERR
  */
 static enum GNUNET_ATS_Network_Type
-http_client_get_network (void *cls, void *session)
+http_client_get_network (void *cls,
+                        struct Session *session)
 {
-       struct Session *s = (struct Session *) session;
-       GNUNET_assert (NULL != s);
-       return ntohl(s->ats_address_network_type);
+  GNUNET_assert (NULL != session);
+  return ntohl (session->ats_address_network_type);
 }
 
 
@@ -1539,6 +1541,12 @@ http_client_plugin_get_session (void *cls,
   s->put_tmp_disconnected = GNUNET_NO;
   client_start_session_timeout (s);
 
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                   "Created new session %p for `%s' address `%s''\n",
+                   s,
+                   http_common_plugin_address_to_string (NULL, plugin->protocol, s->addr, s->addrlen),
+                   GNUNET_i2s (&s->target));
+
   /* add new session */
   GNUNET_CONTAINER_DLL_insert (plugin->head, plugin->tail, s);
 
@@ -1764,7 +1772,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);
 }
 
 /**