]> git.ipfire.org Git - thirdparty/openssl.git/commit
s_socket: naccept: close listening socket after accepting clients
authorNadav Tasher <tashernadav@gmail.com>
Fri, 20 Dec 2024 15:59:01 +0000 (17:59 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 22 Jan 2025 08:20:43 +0000 (09:20 +0100)
commitbc2c1fd194d708d03333de7b77401a5beba4c192
treece15533dc862a12e8441e9f4edd0ca75ae0fae8c
parent4f7d8b2724ea7f42cff1e8a0e736ad448def60f5
s_socket: naccept: close listening socket after accepting clients

When `-naccept` is passed (i.e with `s_server`), the listening socket remains open while handling
client, even after `naccept` is supposed to reach `0`.

This is caused to to the decrementation of `naccept` and closing of the socket
happening a little too late in the `do_server` function.

Signed-off-by: Nadav Tasher <tashernadav@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26228)

(cherry picked from commit 113c12ee8cee2be232a361da277a2ab48807eeed)
apps/lib/s_socket.c