zapret2-fork/nfq2/winnative/tests/run.sh
loop-uh dc41b27493
Some checks failed
build.yml / winws2 native: send the held batch before the receive loop exits (push) Failing after 0s
winws2 native: send the held batch before the receive loop exits
Unmodified packets were held until the next receive. On quit and when the
logical network disappears upstream leaves windivert_recv() before receiving,
so the last run (up to 128 packets) never reached the network. Stress on win10:
20 of 20 stops lost a full run, 2548 packets in total; 0 after the fix.

usleep(0), which starts windivert_recv_exit(), now sends the run and polls the
control events, as cygwin delivered signals there. This also makes the term
event work while the engine waits for a logical network (it used to hang).
WinDivertClose forgets the run of the handle without reading the packets.
tests/check_upstream.py fails the sync if upstream drops that usleep call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:16:34 +03:00

9 lines
337 B
Shell
Executable file

#!/bin/sh
# Host side tests of the native winws2 build. No windows needed.
set -e
HERE=$(cd "$(dirname "$0")" && pwd)
TMP=$(mktemp -d)
trap 'rm -rf "$TMP"' EXIT
${HOSTCC:-cc} -O1 -Wall -o "$TMP/test_args" "$HERE/test_args.c" "$HERE/../args.c"
python3 "$HERE/test_args.py" "$TMP/test_args"
python3 "$HERE/check_upstream.py" "$HERE/../.."