diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-03-02 20:04:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-03-02 20:04:56 +0000 |
commit | c4bcbfbe216ca485637452f9060f439098e67ab9 (patch) | |
tree | 57c8ad84c0af7c6ee32b86dd866331b8990cda38 /src/transport/plugin_transport_tcp.c | |
parent | d1e691eb80325674451ce9cc1cc961fdab277c7a (diff) | |
download | gnunet-c4bcbfbe216ca485637452f9060f439098e67ab9.tar.gz gnunet-c4bcbfbe216ca485637452f9060f439098e67ab9.zip |
finally fix #3698
Diffstat (limited to 'src/transport/plugin_transport_tcp.c')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 3a283e17b..531a81681 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -2545,6 +2545,8 @@ connect_notify (void *cls, | |||
2545 | { | 2545 | { |
2546 | struct Plugin *plugin = cls; | 2546 | struct Plugin *plugin = cls; |
2547 | 2547 | ||
2548 | if (NULL == client) | ||
2549 | return; | ||
2548 | plugin->cur_connections++; | 2550 | plugin->cur_connections++; |
2549 | GNUNET_STATISTICS_set (plugin->env->stats, | 2551 | GNUNET_STATISTICS_set (plugin->env->stats, |
2550 | gettext_noop ("# TCP server connections active"), | 2552 | gettext_noop ("# TCP server connections active"), |
@@ -2583,7 +2585,10 @@ disconnect_notify (void *cls, | |||
2583 | 2585 | ||
2584 | if (NULL == client) | 2586 | if (NULL == client) |
2585 | return; | 2587 | return; |
2586 | session = lookup_session_by_client (plugin, client); | 2588 | GNUNET_assert (plugin->cur_connections >= 1); |
2589 | plugin->cur_connections--; | ||
2590 | session = lookup_session_by_client (plugin, | ||
2591 | client); | ||
2587 | if (NULL == session) | 2592 | if (NULL == session) |
2588 | return; /* unknown, nothing to do */ | 2593 | return; /* unknown, nothing to do */ |
2589 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2594 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -2601,8 +2606,6 @@ disconnect_notify (void *cls, | |||
2601 | GNUNET_NO); | 2606 | GNUNET_NO); |
2602 | GNUNET_SERVER_resume (plugin->server); /* Resume server */ | 2607 | GNUNET_SERVER_resume (plugin->server); /* Resume server */ |
2603 | } | 2608 | } |
2604 | GNUNET_assert (plugin->cur_connections >= 1); | ||
2605 | plugin->cur_connections--; | ||
2606 | GNUNET_STATISTICS_set (plugin->env->stats, | 2609 | GNUNET_STATISTICS_set (plugin->env->stats, |
2607 | gettext_noop ("# TCP server connections active"), | 2610 | gettext_noop ("# TCP server connections active"), |
2608 | plugin->cur_connections, | 2611 | plugin->cur_connections, |