-GArik: fix typo
[oweals/gnunet.git] / src / dv / plugin_transport_dv.c
index feb8a2e574867c2dcbc01f0b86f588966f9c40f7..78200e6342a2527771b7867536b05588ff4d0059 100644 (file)
@@ -160,19 +160,29 @@ handle_dv_message_received (void *cls, struct GNUNET_PeerIdentity *sender,
                    my_id, GNUNET_i2s (sender),
                    ntohs (((struct GNUNET_MessageHeader *) msg)->type),
                    distance);
+  if (sender_address_len == (2 * sizeof (struct GNUNET_PeerIdentity)))
+  {
+    GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "plugin_transport_dv",
+                     "Parsed sender address: %s:%s\n",
+                     GNUNET_i2s ((struct GNUNET_PeerIdentity *) sender_address),
+                     GNUNET_h2s (&
+                                 ((struct GNUNET_PeerIdentity *)
+                                  &sender_address[sizeof
+                                                  (struct
+                                                   GNUNET_PeerIdentity)])->hashPubKey));
+  }
+
   GNUNET_free_non_null (my_id);
 #endif
-  struct GNUNET_TRANSPORT_ATS_Information ats[2];
+  struct GNUNET_ATS_Information ats[1];
 
-  ats[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE);
+  ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
   ats[0].value = htonl (distance);
-  ats[1].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR);
-  ats[1].value = htonl (0);
 
   plugin->env->receive (plugin->env->cls, sender,
                         (struct GNUNET_MessageHeader *) msg,
-                        (const struct GNUNET_TRANSPORT_ATS_Information *) &ats,
-                        2, NULL, sender_address, sender_address_len);
+                        (const struct GNUNET_ATS_Information *) &ats, 1, NULL,
+                        sender_address, sender_address_len);
 
 }
 
@@ -367,6 +377,7 @@ dv_plugin_check_address (void *cls, const void *addr, size_t addrlen)
     }
     return GNUNET_SYSERR;
   }
+
   return GNUNET_OK;
 }