fix peer ids
[oweals/gnunet.git] / src / transport / plugin_transport_http.c
index 7f78f0e4f65ccdc6c945ce5184075c9c327c43d9..937f4f62f486a9e92e9b39b14b1e028cafcfacb5 100644 (file)
@@ -188,20 +188,18 @@ http_plugin_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
   struct Session *s = cls;
   struct Plugin *plugin = s->plugin;
   struct GNUNET_TIME_Relative delay;
-  struct GNUNET_ATS_Information atsi[2];
+  struct GNUNET_ATS_Information atsi;
 
-  atsi[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
-  atsi[0].value = htonl (1);
-  atsi[1].type = htonl (GNUNET_ATS_NETWORK_TYPE);
-  atsi[1].value = session->ats_address_network_type;
+  atsi.type = htonl (GNUNET_ATS_NETWORK_TYPE);
+  atsi.value = session->ats_address_network_type;
   GNUNET_break (session->ats_address_network_type != ntohl (GNUNET_ATS_NET_UNSPECIFIED));
 
   reschedule_session_timeout (session);
 
   delay =
       plugin->env->receive (plugin->env->cls, &s->target, message,
-                            (const struct GNUNET_ATS_Information *) &atsi,
-                            2, s, s->addr, s->addrlen);
+                            &atsi,
+                            1, s, s->addr, s->addrlen);
   return delay;
 }
 
@@ -734,7 +732,7 @@ nat_add_address (void *cls, int add_remove, const struct sockaddr *addr,
   GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
                    "Notifying transport to add address `%s'\n", w->addr->addr);
 
-  plugin->env->notify_address (plugin->env->cls, add_remove, w->addr, haddrlen);
+  plugin->env->notify_address (plugin->env->cls, add_remove, w->addr, haddrlen, "http");
 }
 
 
@@ -757,7 +755,7 @@ nat_remove_address (void *cls, int add_remove, const struct sockaddr *addr,
 
   GNUNET_CONTAINER_DLL_remove (plugin->addr_head, plugin->addr_tail, w);
   plugin->env->notify_address (plugin->env->cls, add_remove, w->addr,
-       sizeof (struct HttpAddress) + ntohl (w->addr->addr_len));
+       sizeof (struct HttpAddress) + ntohl (w->addr->addr_len), "http");
   GNUNET_free (w->addr);
   GNUNET_free (w);
 }
@@ -1093,7 +1091,7 @@ notify_external_hostname (void *cls, const struct GNUNET_SCHEDULER_TaskContext *
                    "Notifying transport about external hostname address `%s'\n", addr);
 
   GNUNET_free (addr);
-  plugin->env->notify_address (plugin->env->cls, GNUNET_YES, eaddr, eaddr_len);
+  plugin->env->notify_address (plugin->env->cls, GNUNET_YES, eaddr, eaddr_len, "http");
   plugin->ext_addr = eaddr;
   plugin->ext_addr_len = eaddr_len;
 }
@@ -1263,8 +1261,10 @@ session_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
   s->timeout_task = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_log (TIMEOUT_LOG,
-              "Session %p was idle for %llu ms, disconnecting\n",
-              s, (unsigned long long) TIMEOUT.rel_value);
+              "Session %p was idle for %s, disconnecting\n",
+              s,
+             GNUNET_STRINGS_relative_time_to_string (TIMEOUT,
+                                                     GNUNET_YES));
 
   /* call session destroy function */
   if (s->inbound == GNUNET_NO)
@@ -1286,8 +1286,10 @@ start_session_timeout (struct Session *s)
                                                   &session_timeout,
                                                   s);
  GNUNET_log (TIMEOUT_LOG,
-             "Timeout for session %p set to %llu ms\n",
-             s,  (unsigned long long) TIMEOUT.rel_value);
+             "Timeout for session %p set to %s\n",
+             s,
+            GNUNET_STRINGS_relative_time_to_string (TIMEOUT,
+                                                    GNUNET_YES));
 }
 
 
@@ -1305,8 +1307,10 @@ reschedule_session_timeout (struct Session *s)
                                                   &session_timeout,
                                                   s);
  GNUNET_log (TIMEOUT_LOG,
-             "Timeout rescheduled for session %p set to %llu ms\n",
-             s, (unsigned long long) TIMEOUT.rel_value);
+             "Timeout rescheduled for session %p set to %s\n",
+             s,
+            GNUNET_STRINGS_relative_time_to_String (TIMEOUT,
+                                                    GNUNET_YES));
 }
 
 
@@ -1447,7 +1451,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
 
   if (NULL != plugin->ext_addr)
   {
-      plugin->env->notify_address (plugin->env->cls, GNUNET_NO, plugin->ext_addr, plugin->ext_addr_len);
+      plugin->env->notify_address (plugin->env->cls, GNUNET_NO, plugin->ext_addr, plugin->ext_addr_len, "http");
       GNUNET_free (plugin->ext_addr);
   }