diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-25 21:08:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-25 21:08:22 +0000 |
commit | 260d4269dd93fd8e4e5af766e15970251c5b7ac9 (patch) | |
tree | 6b2b7ac3e1ba4224791518a38276efdd9729bb65 /src/transport/plugin_transport_udp.c | |
parent | ee266d0bd0b96c67ac1c7f76fff41980bb181e64 (diff) | |
download | gnunet-260d4269dd93fd8e4e5af766e15970251c5b7ac9.tar.gz gnunet-260d4269dd93fd8e4e5af766e15970251c5b7ac9.zip |
-undo bad commit
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r-- | src/transport/plugin_transport_udp.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index 5b882af26..76c9dfdec 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -1327,13 +1327,10 @@ udp_disconnect_session (void *cls, | |||
1327 | struct UDP_MessageWrapper *next; | 1327 | struct UDP_MessageWrapper *next; |
1328 | struct FindReceiveContext frc; | 1328 | struct FindReceiveContext frc; |
1329 | 1329 | ||
1330 | GNUNET_assert (GNUNET_YES != s->in_destroy); | 1330 | GNUNET_assert(GNUNET_YES != s->in_destroy); |
1331 | LOG(GNUNET_ERROR_TYPE_DEBUG, | 1331 | LOG(GNUNET_ERROR_TYPE_DEBUG, "Session %p to peer `%s' address ended\n", s, |
1332 | "Session %p to peer `%s' address ended\n", s, | ||
1333 | GNUNET_i2s (&s->target), | 1332 | GNUNET_i2s (&s->target), |
1334 | udp_address_to_string (NULL, | 1333 | udp_address_to_string (NULL, s->address->address, s->address->address_length)); |
1335 | s->address->address, | ||
1336 | s->address->address_length)); | ||
1337 | /* stop timeout task */ | 1334 | /* stop timeout task */ |
1338 | if (NULL != s->timeout_task) | 1335 | if (NULL != s->timeout_task) |
1339 | { | 1336 | { |
@@ -1408,10 +1405,10 @@ udp_disconnect_session (void *cls, | |||
1408 | } | 1405 | } |
1409 | } | 1406 | } |
1410 | 1407 | ||
1411 | GNUNET_assert (GNUNET_YES == | 1408 | GNUNET_assert(GNUNET_YES == |
1412 | GNUNET_CONTAINER_multipeermap_remove (plugin->sessions, | 1409 | GNUNET_CONTAINER_multipeermap_remove (plugin->sessions, |
1413 | &s->target, | 1410 | &s->target, |
1414 | s)); | 1411 | s)); |
1415 | GNUNET_STATISTICS_set (plugin->env->stats, | 1412 | GNUNET_STATISTICS_set (plugin->env->stats, |
1416 | "# UDP sessions active", | 1413 | "# UDP sessions active", |
1417 | GNUNET_CONTAINER_multipeermap_size (plugin->sessions), | 1414 | GNUNET_CONTAINER_multipeermap_size (plugin->sessions), |
@@ -2338,8 +2335,7 @@ process_udp_message (struct Plugin *plugin, | |||
2338 | address = GNUNET_HELLO_address_allocate ( &msg->sender, PLUGIN_NAME, | 2335 | address = GNUNET_HELLO_address_allocate ( &msg->sender, PLUGIN_NAME, |
2339 | arg, args, | 2336 | arg, args, |
2340 | GNUNET_HELLO_ADDRESS_INFO_INBOUND); | 2337 | GNUNET_HELLO_ADDRESS_INFO_INBOUND); |
2341 | if ( (NULL == (s = udp_plugin_lookup_session (plugin, address))) && | 2338 | if (NULL == (s = udp_plugin_lookup_session (plugin, address))) |
2342 | (GNUNET_YES != s->in_destroy) ) | ||
2343 | { | 2339 | { |
2344 | s = udp_plugin_create_session (plugin, address); | 2340 | s = udp_plugin_create_session (plugin, address); |
2345 | plugin->env->session_start (NULL, address, s, NULL, 0); | 2341 | plugin->env->session_start (NULL, address, s, NULL, 0); |
@@ -2358,12 +2354,9 @@ process_udp_message (struct Plugin *plugin, | |||
2358 | si.arg = arg; | 2354 | si.arg = arg; |
2359 | si.args = args; | 2355 | si.args = args; |
2360 | s->rc++; | 2356 | s->rc++; |
2361 | GNUNET_SERVER_mst_receive (plugin->mst, | 2357 | GNUNET_SERVER_mst_receive (plugin->mst, &si, (const char *) &msg[1], |
2362 | &si, | 2358 | ntohs (msg->header.size) - sizeof(struct UDPMessage), GNUNET_YES, |
2363 | (const char *) &msg[1], | 2359 | GNUNET_NO); |
2364 | ntohs (msg->header.size) - sizeof(struct UDPMessage), | ||
2365 | GNUNET_YES, | ||
2366 | GNUNET_NO); | ||
2367 | s->rc--; | 2360 | s->rc--; |
2368 | if ((0 == s->rc) && (GNUNET_YES == s->in_destroy)) | 2361 | if ((0 == s->rc) && (GNUNET_YES == s->in_destroy)) |
2369 | free_session (s); | 2362 | free_session (s); |
@@ -3621,12 +3614,12 @@ libgnunet_plugin_transport_udp_done (void *cls) | |||
3621 | return NULL; | 3614 | return NULL; |
3622 | } | 3615 | } |
3623 | stop_broadcast (plugin); | 3616 | stop_broadcast (plugin); |
3624 | if (plugin->select_task != NULL) | 3617 | if (plugin->select_task != NULL ) |
3625 | { | 3618 | { |
3626 | GNUNET_SCHEDULER_cancel (plugin->select_task); | 3619 | GNUNET_SCHEDULER_cancel (plugin->select_task); |
3627 | plugin->select_task = NULL; | 3620 | plugin->select_task = NULL; |
3628 | } | 3621 | } |
3629 | if (plugin->select_task_v6 != NULL) | 3622 | if (plugin->select_task_v6 != NULL ) |
3630 | { | 3623 | { |
3631 | GNUNET_SCHEDULER_cancel (plugin->select_task_v6); | 3624 | GNUNET_SCHEDULER_cancel (plugin->select_task_v6); |
3632 | plugin->select_task_v6 = NULL; | 3625 | plugin->select_task_v6 = NULL; |