net: merge HTTP headers and body when the sum is small enough.
net: merge HTTP headers and body when the sum is small enough.

When sending a small POST message we currently do two writes: one for the
headers and one for the body. With 1/n-1 record splitting, this results in four
TLS records when the connection uses CBC.

Plesk correctly handles record splitting in HTTP headers, but incorrectly
assumes that the entire POST body is in a single TLS record. Thus record
splitting causes Chrome to be unable to log into Plesk (or perform any other
action that requires a POST.)

IE and Firefox 10 also do record splitting, but they merge the headers and body
so there's only a single split after the first byte of the headers and Plesk
can handle this.

Our histogram data suggests that ~4% of requests can be merged in the fashion
of this patch, so it seems independently worthwhile to do this.

BUG=107966
TEST=none


Review URL: http://codereview.chromium.org/9133007

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@118099 0039d316-1c4b-4281-b951-d872f2087c98

adobe/chromium,yitian134/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,adobe/chromium,adobe/chromium,adobe/chromium,adobe/chromium,gavinp/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,gavinp/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,adobe/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,ropik/chromium