Suppress 400 if client disconnected (mk 2) #20

Merged
merged 3 commits into from Sep 18, 2011

Projects

None yet

2 participants

@athomason
Contributor

This updates #18, more correctly this time. This is a new pull requests github didn't pull the latest commit into that one.

@miyagawa miyagawa merged commit 505bb86 into miyagawa:master Sep 18, 2011
@miyagawa
Owner

Just a thought - is it possible to write a unit test for this?

@athomason
Contributor

Sure, I've added one (845ceda) that tests that empty or incomplete-header requests followed by a shutdown(2) call cause Twiggy to not respond with anything. This doesn't cover the case where the client calls close(2), but since both events are seen as PIPE signals on the server side, that should be ok. A test that actually watches the wire with tcpdump or something (which is how I noticed this originally) seems rather more complicated than necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment