]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
rsync spawner: Poll all read file descriptors
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 8 Apr 2025 17:33:36 +0000 (11:33 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 8 Apr 2025 17:33:36 +0000 (11:33 -0600)
commit29fe78d9d1be17e0fa2ef1f7dbbf184280ed7c7b
treeb6b23dfae589f8a8099fa02a4f08d5fabc8505c9
parentfd961c9472277f95b9ad47bbd480eac1fd6a4cf7
rsync spawner: Poll all read file descriptors

The single thread requirement and lack of polling was preventing the
spawner from running multiple rsyncs at the same time (as their output
needs to be exhausted for them to end), and more importantly, from
consuming the request stream while the one rsync was running. (The
latter might result in dropped requests if too many rsyncs are queued.)

Therefore, poll both the request stream and the rsync pipes. All input
is now consumed immediately, and multiple rsyncs can be forked at the
same time. (Still needs a limit.)
26 files changed:
src/asn1/asn1c/Makefile.include
src/asn1/asn1c/OCTET_STRING.h
src/asn1/asn1c/RsyncRequest.c [new file with mode: 0644]
src/asn1/asn1c/RsyncRequest.h [new file with mode: 0644]
src/cache.c
src/common.c
src/common.h
src/file.c
src/main.c
src/object/tal.c
src/print_file.c
src/rsync.c
src/rsync.h
src/stream.c
src/stream.h
test/Makefile.am
test/asn1/asn1c/asn1stream_test.c [new file with mode: 0644]
test/cache_test.c
test/common_test.c
test/resources/rsync/drip-feed-timeout.sh [new file with mode: 0755]
test/resources/rsync/drip-feed.sh [new file with mode: 0755]
test/resources/rsync/fast.sh [new file with mode: 0755]
test/resources/rsync/stalled-timeout.sh [new file with mode: 0755]
test/resources/rsync/stalled.sh [new file with mode: 0755]
test/rsync_test.c
test/stream_test.c [new file with mode: 0644]