]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[http] Treat any unexpected connection close as an error
authorMichael Brown <mcb30@ipxe.org>
Wed, 15 Aug 2012 15:29:22 +0000 (16:29 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 15 Aug 2012 15:29:22 +0000 (16:29 +0100)
commit501527daab88a2911f5309d5215decf7011a7fde
tree067bb5e8eea2e2f3762aefd12474306754eaa8bf
parentc7eea31ed8d2c138ff4ebe6e7c9ced3ba7341ab6
[http] Treat any unexpected connection close as an error

iPXE currently checks that the server has not closed the connection
mid-stream (i.e. in the middle of a chunked transfer, or before the
specified Content-Length has been received), but does not check that
the server got as far as starting to send data.  Consequently, if the
server closes the connection before any data is transferred (e.g. if
the server gives up waiting while iPXE performs the validation steps
for TLS), then iPXE will treat this as a successful transfer of a
zero-length file.

Fix by checking the RX connection state, and forcing an error if the
server has closed the connection at an unexpected point.

Originally-fixed-by: Marin Hannache <mareo@mareo.fr>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tcp/httpcore.c