From b65706ffc4f520bea6618b7b8e1a68b7e92431b5 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 19 Nov 2022 21:42:54 +0000 Subject: [PATCH] Don't close the parent connection when a tunnel closes. Just clean up the request through it. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4053 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.c | 7 +++---- src/ssb.tests.c | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) 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);