Stock Browser splitting HTTP POST requests into separate TCP segments I am currently testing different web browsers and devices for compatibility with a web interface that has been developed.  We have realized we have an issue with code already in production.  The bug is hit because any HTTP POST requests sent from the android browser (on both a Galaxy Nexus (running JB) and a Galaxy Tab (running ICS)) are split into two TCP segments at the boundary of the HTTP headers and the HTTP POST data.

Interestingly enough Chrome for Android does not exhibit this same behavior, rather the entire request is sent as one packet.

We are not even close to hitting the MTU, so that is not an issue.

My questions are:


Is there any configuration that can be changed to prevent this?
I know that both the built-in android browser and chrome use Webkit, which I was under the impression that it was built into the android OS, so why the different behavior between the browsers?
Finally, what is gained or what is the intent behind this?
The browser doesn't directly control that; it's the kernel's choice, since the kernel is where the TCP implementation lives.  However, one way the application can influence it is by setting the TCP_NODELAY option on the socket, which requests that the kernel disable Nagle's algorithm and send each chunk of data as soon as possible.

This may be an optimization:  since many HTTP requests contain only headers and no body, it's better for the kernel to send a packet with the headers immediately, instead of waiting a little while to see if the browser produces any more data that could fit into the same packet.