diff options
author | Selva Nair | 2023-01-01 16:51:07 -0500 |
---|---|---|
committer | Gert Doering | 2023-01-08 17:47:43 +0100 |
commit | 3a7257925791a086c1ac88362a8eb422be518b14 (patch) | |
tree | 3f1254b22c72d9d7199f7cd4f0d75ded32ad034d /src/openvpn/proxy.c | |
parent | 22977577ed128ac953e7ebfe30f839bcf651b334 (diff) | |
download | openvpn-3a7257925791a086c1ac88362a8eb422be518b14.zip openvpn-3a7257925791a086c1ac88362a8eb422be518b14.tar.gz |
Assign and honour signal priority order
Signals are ordered as SIGUSR2, SIGUSR1, SIGHUP, SIGTERM, SIGINT
in increasing priority. Lower priority signals are not allowed to
overwrite higher ones.
This should fix Trac #311, #639 -- SIGTER/SIGINT lost during dns
resolution (except for the Windows-specific bug handled in previous commit).
On sending SIGTERM during dns resolution, it still takes several seconds
to terminate as the signal will get processed only after getaddrinfo times
out twice (in phase1 and phase2 inits).
Github: fixes OpenVPN/openvpn#205
Trac: #311, #639
Note: one has to still wait for address resolution to time out as
getaddrinfo() is no interruptible. But a single ctrl-C (and some
patience) is enough.
Signed-off-by: Selva Nair <selva.nair@gmail.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20230101215109.1521549-4-selva.nair@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25871.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/proxy.c')
-rw-r--r-- | src/openvpn/proxy.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c index 91121f2..120ba85 100644 --- a/src/openvpn/proxy.c +++ b/src/openvpn/proxy.c @@ -1080,10 +1080,7 @@ done: return ret; error: - if (!sig_info->signal_received) - { - register_signal(sig_info, SIGUSR1, "HTTP proxy error"); /* SOFT-SIGUSR1 -- HTTP proxy error */ - } + register_signal(sig_info, SIGUSR1, "HTTP proxy error"); /* SOFT-SIGUSR1 -- HTTP proxy error */ gc_free(&gc); return ret; } |