Skip to content

Commit b36045c

Browse files
Eric Wonggitster
authored andcommitted
http-backend: buffer headers before sending
Avoid waking up the readers for unnecessary context switches for each line of header data being written, as all the headers are written in short succession. It is unlikely any HTTP/1.x server would want to read a CGI response one-line-at-a-time and trickle each to the client. Instead, I'd expect HTTP servers want to minimize syscall and TCP/IP framing overhead by trying to send all of its response headers in a single syscall or even combining the headers and first chunk of the body with MSG_MORE or writev. Verified by strace-ing response parsing on the CGI side. Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 00f27fe commit b36045c

File tree

1 file changed

+116
-104
lines changed

1 file changed

+116
-104
lines changed

0 commit comments

Comments
 (0)