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 | |
parent | d1e691eb80325674451ce9cc1cc961fdab277c7a (diff) | |
download | gnunet-c4bcbfbe216ca485637452f9060f439098e67ab9.tar.gz gnunet-c4bcbfbe216ca485637452f9060f439098e67ab9.zip |
finally fix #3698
Diffstat (limited to 'src')
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 9 | ||||
-rw-r--r-- | src/util/server.c | 6 |
2 files changed, 10 insertions, 5 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, |
diff --git a/src/util/server.c b/src/util/server.c index 000e09e0f..1a4b73126 100644 --- a/src/util/server.c +++ b/src/util/server.c | |||
@@ -813,7 +813,8 @@ GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *server) | |||
813 | } | 813 | } |
814 | while (NULL != (npos = server->disconnect_notify_list_head)) | 814 | while (NULL != (npos = server->disconnect_notify_list_head)) |
815 | { | 815 | { |
816 | npos->callback (npos->callback_cls, NULL); | 816 | npos->callback (npos->callback_cls, |
817 | NULL); | ||
817 | GNUNET_CONTAINER_DLL_remove (server->disconnect_notify_list_head, | 818 | GNUNET_CONTAINER_DLL_remove (server->disconnect_notify_list_head, |
818 | server->disconnect_notify_list_tail, | 819 | server->disconnect_notify_list_tail, |
819 | npos); | 820 | npos); |
@@ -821,7 +822,8 @@ GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *server) | |||
821 | } | 822 | } |
822 | while (NULL != (npos = server->connect_notify_list_head)) | 823 | while (NULL != (npos = server->connect_notify_list_head)) |
823 | { | 824 | { |
824 | npos->callback (npos->callback_cls, NULL); | 825 | npos->callback (npos->callback_cls, |
826 | NULL); | ||
825 | GNUNET_CONTAINER_DLL_remove (server->connect_notify_list_head, | 827 | GNUNET_CONTAINER_DLL_remove (server->connect_notify_list_head, |
826 | server->connect_notify_list_tail, | 828 | server->connect_notify_list_tail, |
827 | npos); | 829 | npos); |