be6527325a
This fixes bugs introduced in #3700, by making sure that we behave sanely when an incoming connection is closed before the headers are read.