• Brad Fitzpatrick's avatar
    net/http/fcgi: fix a shutdown race · d7c1f67c
    Brad Fitzpatrick authored
    If a handler didn't consume all its Request.Body, child.go was
    closing the socket while the host was still writing to it,
    causing the child to send a RST and the host (at least nginx)
    to send an empty response body.
    
    Now, we tell the host we're done with the request/response
    first, and then close our input pipe after consuming a bit of
    it. Consuming the body fixes the problem, and flushing to the
    host first to tell it that we're done increases the chance
    that the host cuts off further data to us, meaning we won't
    have much to consume.
    
    No new tests, because this package is lacking in tests.
    Tested by hand with nginx.  See issue for testing details.
    
    Fixes #4183
    
    R=golang-dev, rsc
    CC=golang-dev
    https://golang.org/cl/7939045
    d7c1f67c
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...