The patch changed the default send/receive buffer size on the socket to 1024 which is pretty low considering the normal default, e.g. on my system
- sendBuffer: 131072
- receiveBuffer: 2097152
I can understand that the slow rates are due to starvation of the higher layers based on constant buffer overruns of the underlying socket (and the involved TCP overhead of throttling the datarate). I think the idea outlined by Bogdan, to supply a custom SocketFactory would be a better solution than actually adjusting the socket buffer size in a similar way than the internal buffer.
Another quick fix would be to not to adjust the socket buffers by default, only when the user provides another buffer size. Right now, the socket buffers are always adjusted (to the default, if there is no user-supplied value).