( )⚙ D12068 test-http-bad-server: introduce socket closing after reading a pattern

This is an archive of the discontinued Mercurial Phabricator instance.

test-http-bad-server: introduce socket closing after reading a pattern

Authored by marmoute on Jan 24 2022, 9:48 AM.



We introduce the close-after-recv-patterns option. It has the same goal as
close-after-send-patterns with a slightly different implementation.

Reading "up to a pattern" is hard. As we can only check the pattern from what we
have already read (inlike writing, were we can check what we are about to

So instead we make the close-after-recv-patterns alter the behavior of the
existing close-after-recv-bytes. The value from close-after-recv-bytes only
gets into play after we have seen the pattern from close-after-recv-patterns.

This allow us to achieve the target benefit without changing the read pattern
too much.

Diff Detail

rHG Mercurial
No Linters Available
No Unit Test Coverage

Event Timeline

marmoute created this revision.Jan 24 2022, 9:48 AM
Alphare accepted this revision.Jan 24 2022, 10:43 AM
This revision is now accepted and ready to land.Jan 24 2022, 10:43 AM
baymax updated this revision to Diff 31892.Jan 24 2022, 1:19 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)