aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-01 14:35:15 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-01 14:35:15 +0000
commit1f36ef73e4b6516832ffb40f11be0d2cacb3e0fe (patch)
tree4deacf1e6a5eb055d222b372d7407be6afd036cd
parenta90075761d6e00bec4b1b421b9489a99b54da53c (diff)
downloadgnunet-1f36ef73e4b6516832ffb40f11be0d2cacb3e0fe.tar.gz
gnunet-1f36ef73e4b6516832ffb40f11be0d2cacb3e0fe.zip
-trying to make issues such as #2389 less likely, but I doubt this fixes it
-rw-r--r--src/transport/plugin_transport_tcp.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index a527585cc..88950ea79 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -1694,20 +1694,20 @@ handle_tcp_nat_probe (void *cls, struct GNUNET_SERVER_Client *client,
1694 session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK; 1694 session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK;
1695 } 1695 }
1696 1696
1697 GNUNET_assert (GNUNET_CONTAINER_multihashmap_remove
1698 (plugin->nat_wait_conns,
1699 &tcp_nat_probe->clientIdentity.hashPubKey,
1700 session) == GNUNET_YES);
1701 if (GNUNET_OK != GNUNET_SERVER_client_get_address (client, &vaddr, &alen)) 1697 if (GNUNET_OK != GNUNET_SERVER_client_get_address (client, &vaddr, &alen))
1702 { 1698 {
1703 GNUNET_break (0); 1699 GNUNET_break (0);
1704 GNUNET_free (session); 1700 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
1705 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1701 disconnect_session (session);
1706 return; 1702 return;
1707 } 1703 }
1708 1704 GNUNET_assert (GNUNET_CONTAINER_multihashmap_remove
1709 GNUNET_SERVER_client_keep (client); 1705 (plugin->nat_wait_conns,
1710 session->client = client; 1706 &tcp_nat_probe->clientIdentity.hashPubKey,
1707 session) == GNUNET_YES);
1708 GNUNET_CONTAINER_multihashmap_put(plugin->sessionmap,
1709 &session->target.hashPubKey, session,
1710 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
1711 session->last_activity = GNUNET_TIME_absolute_get (); 1711 session->last_activity = GNUNET_TIME_absolute_get ();
1712 session->inbound = GNUNET_NO; 1712 session->inbound = GNUNET_NO;
1713 LOG (GNUNET_ERROR_TYPE_DEBUG, 1713 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1736,15 +1736,14 @@ handle_tcp_nat_probe (void *cls, struct GNUNET_SERVER_Client *client,
1736 LOG (GNUNET_ERROR_TYPE_DEBUG, 1736 LOG (GNUNET_ERROR_TYPE_DEBUG,
1737 "Bad address for incoming connection!\n"); 1737 "Bad address for incoming connection!\n");
1738 GNUNET_free (vaddr); 1738 GNUNET_free (vaddr);
1739
1740 GNUNET_SERVER_client_drop (client); 1739 GNUNET_SERVER_client_drop (client);
1741 GNUNET_free (session);
1742 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); 1740 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
1741 disconnect_session (session);
1743 return; 1742 return;
1744 } 1743 }
1745 GNUNET_free (vaddr); 1744 GNUNET_free (vaddr);
1746 1745 GNUNET_SERVER_client_keep (client);
1747 GNUNET_CONTAINER_multihashmap_put(plugin->sessionmap, &session->target.hashPubKey, session, GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 1746 session->client = client;
1748 inc_sessions (plugin, session, __LINE__); 1747 inc_sessions (plugin, session, __LINE__);
1749 GNUNET_STATISTICS_update (plugin->env->stats, 1748 GNUNET_STATISTICS_update (plugin->env->stats,
1750 gettext_noop ("# TCP sessions active"), 1, 1749 gettext_noop ("# TCP sessions active"), 1,