http: wait for both prefinish/end to keepalive
Checklist
-
tests and code linting passes -
a test and/or benchmark is included -
documentation is changed or added -
the commit message follows commit guidelines
Affected core subsystem(s)
Description of change
When free
ing the socket to be reused in keep-alive Agent wait for both
prefinish
and end
events. Otherwise the next request may be written
before the previous one has finished sending the body, leading to a
parser errors.
R= @nodejs/http