diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-13 12:48:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-13 12:48:34 +0000 |
commit | fdead2414ccf29e4542d17df5eb18b8bb1d9a878 (patch) | |
tree | 108da53bbe006b4c5a308fbff42d425cf7b79db6 /src/dv/plugin_transport_dv.c | |
parent | f67fd220c5280b352c6cc9f689d5b4fb528092cd (diff) | |
download | gnunet-fdead2414ccf29e4542d17df5eb18b8bb1d9a878.tar.gz gnunet-fdead2414ccf29e4542d17df5eb18b8bb1d9a878.zip |
allow distance change to communicate changes in network of next hop as well, related to #3191, but not sure if it fixes it
Diffstat (limited to 'src/dv/plugin_transport_dv.c')
-rw-r--r-- | src/dv/plugin_transport_dv.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c index 93792e0d9..f80c2aa33 100644 --- a/src/dv/plugin_transport_dv.c +++ b/src/dv/plugin_transport_dv.c | |||
@@ -296,6 +296,7 @@ handle_dv_connect (void *cls, | |||
296 | struct Session *session; | 296 | struct Session *session; |
297 | struct GNUNET_ATS_Information ats[2]; | 297 | struct GNUNET_ATS_Information ats[2]; |
298 | 298 | ||
299 | GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != network); | ||
299 | /** | 300 | /** |
300 | * This requires transport plugin to be linked to libgnunetats. | 301 | * This requires transport plugin to be linked to libgnunetats. |
301 | * If you remove it, also remove libgnunetats linkage from Makefile.am | 302 | * If you remove it, also remove libgnunetats linkage from Makefile.am |
@@ -350,26 +351,28 @@ handle_dv_connect (void *cls, | |||
350 | * @param cls closure with `struct Plugin *` | 351 | * @param cls closure with `struct Plugin *` |
351 | * @param peer connected peer | 352 | * @param peer connected peer |
352 | * @param distance new distance to the peer | 353 | * @param distance new distance to the peer |
354 | * @param network network type used for the connection | ||
353 | */ | 355 | */ |
354 | static void | 356 | static void |
355 | handle_dv_distance_changed (void *cls, | 357 | handle_dv_distance_changed (void *cls, |
356 | const struct GNUNET_PeerIdentity *peer, | 358 | const struct GNUNET_PeerIdentity *peer, |
357 | uint32_t distance) | 359 | uint32_t distance, |
360 | uint32_t network) | ||
358 | { | 361 | { |
359 | struct Plugin *plugin = cls; | 362 | struct Plugin *plugin = cls; |
360 | struct Session *session; | 363 | struct Session *session; |
361 | 364 | ||
362 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message for peer `%s': new distance %u\n", | 365 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
363 | "DV_DISTANCE_CHANGED", | 366 | "Received `%s' message for peer `%s': new distance %u\n", |
364 | GNUNET_i2s (peer), distance); | 367 | "DV_DISTANCE_CHANGED", |
365 | 368 | GNUNET_i2s (peer), | |
369 | distance); | ||
366 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, | 370 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, |
367 | peer); | 371 | peer); |
368 | if (NULL == session) | 372 | if (NULL == session) |
369 | { | 373 | { |
370 | GNUNET_break (0); | 374 | GNUNET_break (0); |
371 | /* FIXME */ | 375 | handle_dv_connect (plugin, peer, distance, network); |
372 | handle_dv_connect (plugin, peer, distance, 0); | ||
373 | return; | 376 | return; |
374 | } | 377 | } |
375 | session->distance = distance; | 378 | session->distance = distance; |