diff --git a/src/ssb.c b/src/ssb.c index 3629cfed..e264c1d7 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -1447,12 +1447,11 @@ void _tf_ssb_connection_destroy(tf_ssb_connection_t* connection, const char* rea again = true; break; } - else if (connection->tunnel_connection == it) + else if (it == connection->tunnel_connection) { + _tf_ssb_connection_remove_request(it, connection->tunnel_request_number); connection->tunnel_connection = NULL; - _tf_ssb_connection_close(it, "tunnel closed"); - again = true; - break; + connection->tunnel_request_number = 0; } } } diff --git a/src/ssb.tests.c b/src/ssb.tests.c index ced5f16b..963b38c3 100644 --- a/src/ssb.tests.c +++ b/src/ssb.tests.c @@ -432,6 +432,8 @@ void tf_ssb_test_rooms(const tf_test_options_t* options) printf("Done.\n"); + tf_ssb_connection_close(tun0); + tf_ssb_send_close(ssb0); tf_ssb_send_close(ssb1); tf_ssb_send_close(ssb2);