Write all HTTP headers to the socket in one go.
We don't have support for TCP_CORK, which would let the kernel handle this, so this resulted in lots of very small packets being sent over the network. Besides the performance issues, this confused aliceadsl.fr HTTP server and prevented logging in to their website. Fixes #10556.
This commit is contained in:
parent
d1e057eefb
commit
6a13b12a9b
@ -914,14 +914,19 @@ BHttpRequest::_SendHeaders()
|
||||
}
|
||||
|
||||
// Write output headers to output stream
|
||||
BString headerData;
|
||||
|
||||
for (int32 headerIndex = 0; headerIndex < fOutputHeaders.CountHeaders();
|
||||
headerIndex++) {
|
||||
const char* header = fOutputHeaders.HeaderAt(headerIndex).Header();
|
||||
fSocket->Write(header, strlen(header));
|
||||
fSocket->Write("\r\n", 2);
|
||||
|
||||
headerData << header;
|
||||
headerData << "\r\n";
|
||||
|
||||
_EmitDebug(B_URL_PROTOCOL_DEBUG_HEADER_OUT, "%s", header);
|
||||
}
|
||||
|
||||
fSocket->Write(headerData.String(), headerData.Length());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user