From 9f41543aad8e65e80ac1d42d9ddcd6aeb37e212b Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Sun, 8 Jan 2017 11:12:57 +0100 Subject: [PATCH] Options so-rcvtimeo and so-sndtimeo do not work with poll() --- CHANGES | 4 ++++ doc/socat.yo | 4 ---- test.sh | 6 ------ xio-socket.c | 6 ------ xio-socket.h | 2 -- xioopts.c | 12 ------------ 6 files changed, 4 insertions(+), 30 deletions(-) diff --git a/CHANGES b/CHANGES index 654b889..67193e6 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,10 @@ corrections: Test: UDP4MAXCHILDREN UDP6MAXCHILDREN Thanks to Leander Berwers for reporting this issue. + Options so-rcvtimeo and so-sndtimeo do not work with poll()/select() + and therefore were useless. + Thanks to Steve Borenstein for reporting this issue. + porting: Type conflict between int and sig_atomic_t between declaration and definition of diag_immediate_type and diag_immediate_exit broke diff --git a/doc/socat.yo b/doc/socat.yo index 717f0c0..792322c 100644 --- a/doc/socat.yo +++ b/doc/socat.yo @@ -1850,8 +1850,6 @@ label(OPTION_RCVBUF_LATE)dit(bf(tt(rcvbuf-late=))) 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_RCVTIMEO)dit(bf(tt(rcvtimeo=))) - Sets the receive timeout [link(timeval)(TYPE_TIMEVAL)]. label(OPTION_REUSEADDR)dit(bf(tt(reuseaddr))) Allows other sockets to bind to an address even if parts of it (e.g. the local port) are already in use by socat() (link(example)(EXAMPLE_OPTION_REUSEADDR)). @@ -1864,8 +1862,6 @@ label(OPTION_SNDBUF_LATE)dit(bf(tt(sndbuf-late=))) label(OPTION_SNDLOWAT)dit(bf(tt(sndlowat=))) Specifies the minimum number of bytes in the send buffer until the socket layer will send the data to [link(int)(TYPE_INT)]. -label(OPTION_SNDTIMEO)dit(bf(tt(sndtimeo=))) - Sets the send timeout to seconds [link(timeval)(TYPE_TIMEVAL)]. label(OPTION_PROTOCOL_FAMILY)dit(bf(tt(pf=))) Forces the use of the specified IP version or protocol. can be something like "ip4" or "ip6". The resulting value is diff --git a/test.sh b/test.sh index 0ad36f7..c146379 100755 --- a/test.sh +++ b/test.sh @@ -512,12 +512,6 @@ filloptionvalues() { *,linger,*) OPTS=$(echo "$OPTS" |sed "s/,linger,/,linger=2,/g");; esac case "$OPTS" in - *,rcvtimeo,*) OPTS=$(echo "$OPTS" |sed "s/,rcvtimeo,/,rcvtimeo=1,/g");; - esac - case "$OPTS" in - *,sndtimeo,*) OPTS=$(echo "$OPTS" |sed "s/,sndtimeo,/,sndtimeo=1,/g");; - esac - case "$OPTS" in *,connect-timeout,*) OPTS=$(echo "$OPTS" |sed "s/,connect-timeout,/,connect-timeout=1,/g");; esac # IP diff --git a/xio-socket.c b/xio-socket.c index ce30e32..f5d520e 100644 --- a/xio-socket.c +++ b/xio-socket.c @@ -103,15 +103,9 @@ const struct optdesc opt_so_dontroute= { "so-dontroute", "dontroute", OPT_SO_DON #ifdef SO_RCVLOWAT const struct optdesc opt_so_rcvlowat = { "so-rcvlowat", "rcvlowat", OPT_SO_RCVLOWAT, GROUP_SOCKET, PH_PASTSOCKET, TYPE_INT, OFUNC_SOCKOPT, SOL_SOCKET, SO_RCVLOWAT }; #endif -#ifdef SO_RCVTIMEO -const struct optdesc opt_so_rcvtimeo = { "so-rcvtimeo", "rcvtimeo", OPT_SO_RCVTIMEO, GROUP_SOCKET, PH_PASTSOCKET, TYPE_TIMEVAL,OFUNC_SOCKOPT,SOL_SOCKET,SO_RCVTIMEO }; -#endif #ifdef SO_SNDLOWAT const struct optdesc opt_so_sndlowat = { "so-sndlowat", "sndlowat", OPT_SO_SNDLOWAT, GROUP_SOCKET, PH_PASTSOCKET, TYPE_INT, OFUNC_SOCKOPT, SOL_SOCKET, SO_SNDLOWAT }; #endif -#ifdef SO_SNDTIMEO -const struct optdesc opt_so_sndtimeo = { "so-sndtimeo", "sndtimeo", OPT_SO_SNDTIMEO, GROUP_SOCKET, PH_PASTSOCKET, TYPE_TIMEVAL,OFUNC_SOCKOPT,SOL_SOCKET,SO_SNDTIMEO }; -#endif /* end of setsockopt options of UNIX98 standard */ #ifdef SO_AUDIT /* AIX 4.3.3 */ diff --git a/xio-socket.h b/xio-socket.h index 9267610..7d18b24 100644 --- a/xio-socket.h +++ b/xio-socket.h @@ -35,9 +35,7 @@ extern const struct optdesc opt_so_error; extern const struct optdesc opt_so_type; extern const struct optdesc opt_so_dontroute; extern const struct optdesc opt_so_rcvlowat; -extern const struct optdesc opt_so_rcvtimeo; extern const struct optdesc opt_so_sndlowat; -extern const struct optdesc opt_so_sndtimeo; extern const struct optdesc opt_so_audit; extern const struct optdesc opt_so_attach_filter; extern const struct optdesc opt_so_detach_filter; diff --git a/xioopts.c b/xioopts.c index b65407c..69f5a27 100644 --- a/xioopts.c +++ b/xioopts.c @@ -1202,9 +1202,6 @@ const struct optname optionnames[] = { IF_SOCKET ("rcvbuf-late", &opt_so_rcvbuf_late) #ifdef SO_RCVLOWAT IF_SOCKET ("rcvlowat", &opt_so_rcvlowat) -#endif -#ifdef SO_RCVTIMEO - IF_SOCKET ("rcvtimeo", &opt_so_rcvtimeo) #endif IF_OPEN ("rdonly", &opt_o_rdonly) IF_OPEN ("rdwr", &opt_o_rdwr) @@ -1374,9 +1371,6 @@ const struct optname optionnames[] = { #ifdef SO_SNDLOWAT IF_SOCKET ("sndlowat", &opt_so_sndlowat) #endif -#ifdef SO_SNDTIMEO - IF_SOCKET ("sndtimeo", &opt_so_sndtimeo) -#endif #ifdef SO_ACCEPTCONN /* AIX433 */ IF_SOCKET ("so-acceptconn", &opt_so_acceptconn) #endif /* SO_ACCEPTCONN */ @@ -1436,9 +1430,6 @@ const struct optname optionnames[] = { IF_SOCKET ("so-rcvbuf-late", &opt_so_rcvbuf_late) #ifdef SO_RCVLOWAT IF_SOCKET ("so-rcvlowat", &opt_so_rcvlowat) -#endif -#ifdef SO_RCVTIMEO - IF_SOCKET ("so-rcvtimeo", &opt_so_rcvtimeo) #endif IF_SOCKET ("so-reuseaddr", &opt_so_reuseaddr) #ifdef SO_REUSEPORT /* AIX 4.3.3 */ @@ -1458,9 +1449,6 @@ const struct optname optionnames[] = { #ifdef SO_SNDLOWAT IF_SOCKET ("so-sndlowat", &opt_so_sndlowat) #endif -#ifdef SO_SNDTIMEO - IF_SOCKET ("so-sndtimeo", &opt_so_sndtimeo) -#endif #ifdef SO_TIMESTAMP IF_SOCKET ("so-timestamp", &opt_so_timestamp) #endif