From 9faf06894943f40ff874bf53e9d0318b047c6e71 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Thu, 26 Oct 2023 16:48:37 +0200 Subject: [PATCH] New options so-rcvtimeo, so-sndtimeo --- CHANGES | 5 +++ doc/socat.yo | 20 +++++++--- test.sh | 111 ++++++++++++++++++++++++++++++++++++++++++--------- xio-socket.c | 7 ++++ xio-socket.h | 2 + xioopts.c | 12 ++++++ xioopts.h | 6 +++ 7 files changed, 139 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index c84d108..f9d4f05 100644 --- a/CHANGES +++ b/CHANGES @@ -32,6 +32,11 @@ Features: Added Info log of resulting OpenSSL max fragment length. + Implemented options rcvtimeo and sndtimeo, the first of which may be + useful to prevent endlessly hanging DTLS connection etablishment. + Test: RCVTIMEO_DTLS + Feature proposed by Vladimir Nikishkin. + Corrections: When a sub process (EXEC, SYSTEM) terminated with exit code other than 0, its last sent data might have been lost depending on timing of read/ diff --git a/doc/socat.yo b/doc/socat.yo index 8cb488d..b7689b7 100644 --- a/doc/socat.yo +++ b/doc/socat.yo @@ -608,7 +608,8 @@ label(ADDRESS_OPENSSL_DTLS_CLIENT)dit(bf(tt(OPENSSL-DTLS-CLIENT::))) link(bind)(OPTION_BIND), link(pf)(OPTION_PROTOCOL_FAMILY), link(sourceport)(OPTION_SOURCEPORT), - link(retry)(OPTION_RETRY)nl() + link(retry)(OPTION_RETRY), + link(rcvtimeo)(OPTION_SO_RCVTIMOE)nl() See also: link(OPENSSL-DTLS-SERVER)(ADDRESS_OPENSSL_DTLS_SERVER), link(OPENSSL-CONNECT)(ADDRESS_OPENSSL_CONNECT), @@ -644,6 +645,7 @@ label(ADDRESS_OPENSSL_DTLS_SERVER)dit(bf(tt(OPENSSL-DTLS-SERVER:))) link(su)(OPTION_SUBSTUSER), link(reuseaddr)(OPTION_REUSEADDR), link(retry)(OPTION_RETRY)nl() + link(rcvtimeo)(OPTION_SO_RCVTIMOE)nl() See also: link(OPENSSL-DTLS-CLIENT)(ADDRESS_OPENSSL_DTLS_CLIENT), link(OPENSSL-LISTEN)(ADDRESS_OPENSSL_LISTEN), @@ -1983,9 +1985,15 @@ label(OPTION_RCVBUF_LATE)dit(bf(tt(rcvbuf-late=))) connected to [link(int)(TYPE_INT)]. With TCP sockets, this value corresponds to the socket's maximal window size. -label(OPTION_RCVLOWAT)dit(bf(tt(rcvlowat=))) - Specifies the minimum number of received bytes [link(int)(TYPE_INT)] until - the socket layer will pass the buffered data to socat(). +label(OPTION_SO_RCVTIMOE)dit(bf(tt(so-rcvtimeo=