mirror of
https://repo.or.cz/socat.git
synced 2025-01-09 06:22:33 +00:00
Option ignoreeof on the right address hung
This commit is contained in:
parent
10011461ec
commit
5bf034ba87
3 changed files with 46 additions and 6 deletions
4
CHANGES
4
CHANGES
|
@ -168,6 +168,10 @@ corrections:
|
||||||
|
|
||||||
Fixed return value of nestlex()
|
Fixed return value of nestlex()
|
||||||
|
|
||||||
|
Option ignoreeof on the right address hung.
|
||||||
|
Test: IGNOREEOF_REV
|
||||||
|
Thanks to Franz Fasching for reporting this bug.
|
||||||
|
|
||||||
porting:
|
porting:
|
||||||
Red Hat issue 1020203: configure checks fail with some compilers.
|
Red Hat issue 1020203: configure checks fail with some compilers.
|
||||||
Use case: clang
|
Use case: clang
|
||||||
|
|
45
test.sh
45
test.sh
|
@ -3542,7 +3542,6 @@ esac
|
||||||
N=$((N+1))
|
N=$((N+1))
|
||||||
|
|
||||||
|
|
||||||
#set -vx
|
|
||||||
NAME=IGNOREEOF
|
NAME=IGNOREEOF
|
||||||
case "$TESTS" in
|
case "$TESTS" in
|
||||||
*%$N%*|*%functions%*|*%engine%*|*%ignoreeof%*|*%$NAME%*)
|
*%$N%*|*%functions%*|*%engine%*|*%ignoreeof%*|*%$NAME%*)
|
||||||
|
@ -3576,7 +3575,41 @@ wait
|
||||||
fi ;; # NUMCOND
|
fi ;; # NUMCOND
|
||||||
esac
|
esac
|
||||||
N=$((N+1))
|
N=$((N+1))
|
||||||
#set +vx
|
|
||||||
|
|
||||||
|
NAME=IGNOREEOF_REV
|
||||||
|
case "$TESTS" in
|
||||||
|
*%$N%*|*%functions%*|*%engine%*|*%ignoreeof%*|*%$NAME%*)
|
||||||
|
TEST="$NAME: ignoreeof on file right-to-left"
|
||||||
|
if ! eval $NUMCOND; then :; else
|
||||||
|
ti="$td/test$N.file"
|
||||||
|
tf="$td/test$N.stdout"
|
||||||
|
te="$td/test$N.stderr"
|
||||||
|
tdiff="$td/test$N.diff"
|
||||||
|
da="test$N $(date) $RANDOM"
|
||||||
|
CMD="$SOCAT $opts -U - file:\"$ti\",ignoreeof"
|
||||||
|
printf "test $F_n $TEST... " $N
|
||||||
|
touch "$ti"
|
||||||
|
$CMD >"$tf" 2>"$te" &
|
||||||
|
bg=$!
|
||||||
|
usleep 500000
|
||||||
|
echo "$da" >>"$ti"
|
||||||
|
sleep 1
|
||||||
|
kill $bg 2>/dev/null
|
||||||
|
if ! echo "$da" |diff - "$tf" >"$tdiff"; then
|
||||||
|
$PRINTF "$FAILED: diff:\n"
|
||||||
|
cat "$tdiff"
|
||||||
|
listFAIL="$listFAIL $N"
|
||||||
|
numFAIL=$((numFAIL+1))
|
||||||
|
else
|
||||||
|
$PRINTF "$OK\n"
|
||||||
|
if [ -n "$debug" ]; then cat $te; fi
|
||||||
|
numOK=$((numOK+1))
|
||||||
|
fi
|
||||||
|
wait
|
||||||
|
fi ;; # NUMCOND
|
||||||
|
esac
|
||||||
|
N=$((N+1))
|
||||||
|
|
||||||
|
|
||||||
NAME=EXECIGNOREEOF
|
NAME=EXECIGNOREEOF
|
||||||
|
@ -7918,7 +7951,7 @@ N=$((N+1))
|
||||||
|
|
||||||
NAME=COOLWRITE
|
NAME=COOLWRITE
|
||||||
case "$TESTS" in
|
case "$TESTS" in
|
||||||
*%$N%*|*%functions%*|*%engine%*|*%timeout%*|*%ignoreeof%*|*%coolwrite%*|*%$NAME%*)
|
*%$N%*|*%functions%*|*%engine%*|*%timeout%*|*%coolwrite%*|*%$NAME%*)
|
||||||
TEST="$NAME: option cool-write"
|
TEST="$NAME: option cool-write"
|
||||||
if ! eval $NUMCOND; then :;
|
if ! eval $NUMCOND; then :;
|
||||||
elif ! testoptions cool-write >/dev/null; then
|
elif ! testoptions cool-write >/dev/null; then
|
||||||
|
@ -7961,7 +7994,7 @@ N=$((N+1))
|
||||||
# this failed up to socat 1.6.0.0
|
# this failed up to socat 1.6.0.0
|
||||||
NAME=COOLSTDIO
|
NAME=COOLSTDIO
|
||||||
case "$TESTS" in
|
case "$TESTS" in
|
||||||
*%$N%*|*%functions%*|*%engine%*|*%timeout%*|*%ignoreeof%*|*%coolwrite%*|*%$NAME%*)
|
*%$N%*|*%functions%*|*%engine%*|*%timeout%*|*%coolwrite%*|*%$NAME%*)
|
||||||
TEST="$NAME: option cool-write on bidirectional stdio"
|
TEST="$NAME: option cool-write on bidirectional stdio"
|
||||||
# this test starts a socat reader that terminates after receiving one+
|
# this test starts a socat reader that terminates after receiving one+
|
||||||
# bytes (option readbytes); and a test process that sends two bytes via
|
# bytes (option readbytes); and a test process that sends two bytes via
|
||||||
|
@ -11886,7 +11919,7 @@ if [ "$fileopt" = "." ]; then fileopt=; fi
|
||||||
if [ "$addropts" = "." ]; then addropts=; fi
|
if [ "$addropts" = "." ]; then addropts=; fi
|
||||||
NAME=${ADDR_}_PERM
|
NAME=${ADDR_}_PERM
|
||||||
case "$TESTS" in
|
case "$TESTS" in
|
||||||
*%$N%*|*%functions%*|*%bugs%*|*%proto%*|*%socket%*|*%$proto%*|*%$NAME%*)
|
*%$N%*|*%functions%*|*%bugs%*|*%proto%*|*%socket%*|*%$proto%*|*%ignoreeof%*|*%$NAME%*)
|
||||||
TEST="$NAME: $ADDR applies option perm"
|
TEST="$NAME: $ADDR applies option perm"
|
||||||
# start a socat process with passive/listening file system entry. Check the
|
# start a socat process with passive/listening file system entry. Check the
|
||||||
# permissions of the FS entry, then terminate the process.
|
# permissions of the FS entry, then terminate the process.
|
||||||
|
@ -11958,7 +11991,7 @@ if [ "$fileopt" = "." ]; then fileopt=; fi
|
||||||
if [ "$addropts" = "." ]; then addropts=; fi
|
if [ "$addropts" = "." ]; then addropts=; fi
|
||||||
NAME=${ADDR_}_USER
|
NAME=${ADDR_}_USER
|
||||||
case "$TESTS" in
|
case "$TESTS" in
|
||||||
*%$N%*|*%functions%*|*%bugs%*|*%proto%*|*%socket%*|*%$proto%*|*%root%*|*%$NAME%*)
|
*%$N%*|*%functions%*|*%bugs%*|*%proto%*|*%socket%*|*%$proto%*|*%root%*|*%ignoreeof%*|*%$NAME%*)
|
||||||
TEST="$NAME: $ADDR applies option user"
|
TEST="$NAME: $ADDR applies option user"
|
||||||
# start a socat process with passive/listening file system entry with user option.
|
# start a socat process with passive/listening file system entry with user option.
|
||||||
# Check the owner of the FS entry, then terminate the process.
|
# Check the owner of the FS entry, then terminate the process.
|
||||||
|
|
|
@ -302,6 +302,9 @@ int _socat(xiofile_t *xfd1, xiofile_t *xfd2) {
|
||||||
if (XIO_RDSTREAM(sock1)->ignoreeof) {
|
if (XIO_RDSTREAM(sock1)->ignoreeof) {
|
||||||
mayrd1 = 0;
|
mayrd1 = 0;
|
||||||
}
|
}
|
||||||
|
if (XIO_RDSTREAM(sock2)->ignoreeof) {
|
||||||
|
mayrd2 = 0;
|
||||||
|
}
|
||||||
} else if (polling && wasaction) {
|
} else if (polling && wasaction) {
|
||||||
wasaction = 0;
|
wasaction = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue