1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/net/telnet: fix race condition on disconnect

This commit is contained in:
Benjamin Valentin 2024-02-02 11:06:28 +01:00
parent 8d205b496b
commit 816aafdb5a

View File

@ -123,6 +123,10 @@ static void _disconnect(void)
DEBUG("telnet disconnect\n");
telnet_cb_disconneced();
_acquire();
sock_tcp_disconnect(client);
_release();
}
static int _write_buffer(const void* buffer, size_t len)
@ -268,7 +272,6 @@ write:
}
disco:
_disconnect();
sock_tcp_disconnect(client);
if (res < 0) {
DEBUG("telnet: read: %s\n", strerror(res));