diff --git a/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp b/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp index f6702672594..b5b904f66b2 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp @@ -44,7 +44,9 @@ #include "nsHttpRequestHead.h" #include "nsHttpResponseHead.h" #include "nsHttpChunkedDecoder.h" +#include "nsNetSegmentUtils.h" #include "nsTransportUtils.h" +#include "nsNetUtil.h" #include "nsProxyRelease.h" #include "nsIOService.h" #include "nsAutoLock.h" @@ -266,7 +268,12 @@ nsHttpTransaction::Init(PRUint8 caps, rv = multi->AppendStream(requestBody); if (NS_FAILED(rv)) return rv; - mRequestStream = multi; + // wrap the multiplexed input stream with a buffered input stream, so + // that we write data in the largest chunks possible. this is actually + // necessary to workaround some common server bugs (see bug 137155). + rv = NS_NewBufferedInputStream(getter_AddRefs(mRequestStream), multi, + NET_DEFAULT_SEGMENT_SIZE); + if (NS_FAILED(rv)) return rv; } else mRequestStream = headers;