mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Back out 9e6567a9d1b2 (bug 790184) for not building
--HG-- extra : rebase_source : 1548e3b813dfd2c92afddeb5870dfa19e447d474
This commit is contained in:
parent
76e687a972
commit
6fe1b2f006
@ -927,7 +927,6 @@ pref("network.http.spdy.coalesce-hostnames", true);
|
||||
pref("network.http.spdy.use-alternate-protocol", true);
|
||||
pref("network.http.spdy.ping-threshold", 44);
|
||||
pref("network.http.spdy.ping-timeout", 8);
|
||||
pref("network.http.spdy.send-buffer-size", 131072);
|
||||
|
||||
pref("network.http.diagnostics", false);
|
||||
|
||||
|
@ -20,7 +20,7 @@ native PRNetAddr(union PRNetAddr);
|
||||
* NOTE: This is a free-threaded interface, meaning that the methods on
|
||||
* this interface may be called from any thread.
|
||||
*/
|
||||
[scriptable, uuid(91ca3523-fc52-4dea-b167-ef8f56473dde)]
|
||||
[scriptable, uuid(704c0859-cb64-43bd-bfdf-c8b28427f812)]
|
||||
interface nsISocketTransport : nsITransport
|
||||
{
|
||||
/**
|
||||
@ -160,10 +160,4 @@ interface nsISocketTransport : nsITransport
|
||||
*/
|
||||
attribute octet QoSBits;
|
||||
|
||||
/**
|
||||
* TCP send and receive buffer sizes. A value of 0 means OS level
|
||||
* auto-tuning is in effect.
|
||||
*/
|
||||
attribute unsigned long recvBufferSize;
|
||||
attribute unsigned long sendBufferSize;
|
||||
};
|
||||
|
@ -2012,112 +2012,6 @@ nsSocketTransport::GetQoSBits(uint8_t *aQoSBits)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::GetRecvBufferSize(uint32_t *aSize)
|
||||
{
|
||||
PRFileDesc *fd;
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
fd = GetFD_Locked();
|
||||
}
|
||||
|
||||
if (!fd)
|
||||
return NS_ERROR_NOT_CONNECTED;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
PRSocketOptionData opt;
|
||||
opt.option = PR_SockOpt_RecvBufferSize;
|
||||
if (PR_GetSocketOption(mFD, &opt) == PR_SUCCESS)
|
||||
*aSize = opt.value.recv_buffer_size;
|
||||
else
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
ReleaseFD_Locked(fd);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::GetSendBufferSize(uint32_t *aSize)
|
||||
{
|
||||
PRFileDesc *fd;
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
fd = GetFD_Locked();
|
||||
}
|
||||
|
||||
if (!fd)
|
||||
return NS_ERROR_NOT_CONNECTED;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
PRSocketOptionData opt;
|
||||
opt.option = PR_SockOpt_SendBufferSize;
|
||||
if (PR_GetSocketOption(mFD, &opt) == PR_SUCCESS)
|
||||
*aSize = opt.value.send_buffer_size;
|
||||
else
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
ReleaseFD_Locked(fd);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::SetRecvBufferSize(uint32_t aSize)
|
||||
{
|
||||
PRFileDesc *fd;
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
fd = GetFD_Locked();
|
||||
}
|
||||
|
||||
if (!fd)
|
||||
return NS_ERROR_NOT_CONNECTED;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
PRSocketOptionData opt;
|
||||
opt.option = PR_SockOpt_RecvBufferSize;
|
||||
opt.value.recv_buffer_size = aSize;
|
||||
if (PR_SetSocketOption(mFD, &opt) != PR_SUCCESS)
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
ReleaseFD_Locked(fd);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::SetSendBufferSize(uint32_t aSize)
|
||||
{
|
||||
PRFileDesc *fd;
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
fd = GetFD_Locked();
|
||||
}
|
||||
|
||||
if (!fd)
|
||||
return NS_ERROR_NOT_CONNECTED;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
PRSocketOptionData opt;
|
||||
opt.option = PR_SockOpt_SendBufferSize;
|
||||
opt.value.send_buffer_size = aSize;
|
||||
if (PR_SetSocketOption(mFD, &opt) != PR_SUCCESS)
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
ReleaseFD_Locked(fd);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::OnLookupComplete(nsICancelable *request,
|
||||
nsIDNSRecord *rec,
|
||||
|
@ -41,7 +41,6 @@ public:
|
||||
virtual void PrintDiagnostics (nsCString &log) = 0;
|
||||
|
||||
const static uint32_t kSendingChunkSize = 4096;
|
||||
const static uint32_t kTCPSendBufferSize = 131072;
|
||||
};
|
||||
|
||||
// this is essentially a single instantiation as a member of nsHttpHandler.
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsISocketTransport.h"
|
||||
#include "nsISupportsPriority.h"
|
||||
#include "nsHttpHandler.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
// defined by the socket transport service while active
|
||||
@ -43,7 +42,6 @@ SpdyStream2::SpdyStream2(nsAHttpTransaction *httpTransaction,
|
||||
mRecvdFin(0),
|
||||
mFullyOpen(0),
|
||||
mSentWaitingFor(0),
|
||||
mSetTCPSocketBuffer(0),
|
||||
mTxInlineFrameSize(SpdySession2::kDefaultBufferSize),
|
||||
mTxInlineFrameUsed(0),
|
||||
mTxStreamFrameSize(0),
|
||||
@ -471,23 +469,6 @@ SpdyStream2::UpdateTransportSendEvents(uint32_t count)
|
||||
{
|
||||
mTotalSent += count;
|
||||
|
||||
// normally on non-windows platform we use TCP autotuning for
|
||||
// the socket buffers, and this works well (managing enough
|
||||
// buffers for BDP while conserving memory) for HTTP even when
|
||||
// it creates really deep queues. However this 'buffer bloat' is
|
||||
// a problem for spdy because it ruins the low latency properties
|
||||
// necessary for PING and cancel to work meaningfully.
|
||||
//
|
||||
// If this stream represents a large upload, disable autotuning for
|
||||
// the session and cap the send buffers by default at 128KB.
|
||||
// (10Mbit/sec @ 100ms)
|
||||
//
|
||||
uint32_t bufferSize = gHttpHandler->SpdySendBufferSize();
|
||||
if ((mTotalSent > bufferSize) && !mSetTCPSocketBuffer) {
|
||||
mSetTCPSocketBuffer = 1;
|
||||
mSocketTransport->SetSendBufferSize(bufferSize);
|
||||
}
|
||||
|
||||
if (mUpstreamState != SENDING_FIN_STREAM)
|
||||
mTransaction->OnTransportStatus(mSocketTransport,
|
||||
NS_NET_STATUS_SENDING_TO,
|
||||
|
@ -143,9 +143,6 @@ private:
|
||||
// Flag is set after the WAITING_FOR Transport event has been generated
|
||||
uint32_t mSentWaitingFor : 1;
|
||||
|
||||
// Flag is set after TCP send autotuning has been disabled
|
||||
uint32_t mSetTCPSocketBuffer : 1;
|
||||
|
||||
// The InlineFrame and associated data is used for composing control
|
||||
// frames and data frame headers.
|
||||
nsAutoArrayPtr<char> mTxInlineFrame;
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsISocketTransport.h"
|
||||
#include "nsISupportsPriority.h"
|
||||
#include "nsHttpHandler.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
// defined by the socket transport service while active
|
||||
@ -44,7 +43,6 @@ SpdyStream3::SpdyStream3(nsAHttpTransaction *httpTransaction,
|
||||
mFullyOpen(0),
|
||||
mSentWaitingFor(0),
|
||||
mReceivedData(0),
|
||||
mSetTCPSocketBuffer(0),
|
||||
mTxInlineFrameSize(SpdySession3::kDefaultBufferSize),
|
||||
mTxInlineFrameUsed(0),
|
||||
mTxStreamFrameSize(0),
|
||||
@ -491,24 +489,6 @@ SpdyStream3::UpdateTransportSendEvents(uint32_t count)
|
||||
{
|
||||
mTotalSent += count;
|
||||
|
||||
// normally on non-windows platform we use TCP autotuning for
|
||||
// the socket buffers, and this works well (managing enough
|
||||
// buffers for BDP while conserving memory) for HTTP even when
|
||||
// it creates really deep queues. However this 'buffer bloat' is
|
||||
// a problem for spdy because it ruins the low latency properties
|
||||
// necessary for PING and cancel to work meaningfully.
|
||||
//
|
||||
// If this stream represents a large upload, disable autotuning for
|
||||
// the session and cap the send buffers by default at 128KB.
|
||||
// (10Mbit/sec @ 100ms)
|
||||
//
|
||||
uint32_t bufferSize = gHttpHandler->SpdySendBufferSize();
|
||||
fprintf(stderr,"update %u %u\n", mTotalSent, bufferSize);
|
||||
if ((mTotalSent > bufferSize) && !mSetTCPSocketBuffer) {
|
||||
mSetTCPSocketBuffer = 1;
|
||||
mSocketTransport->SetSendBufferSize(bufferSize);
|
||||
}
|
||||
|
||||
if (mUpstreamState != SENDING_FIN_STREAM)
|
||||
mTransaction->OnTransportStatus(mSocketTransport,
|
||||
NS_NET_STATUS_SENDING_TO,
|
||||
|
@ -169,9 +169,6 @@ private:
|
||||
// which additional HEADERS data is invalid
|
||||
uint32_t mReceivedData : 1;
|
||||
|
||||
// Flag is set after TCP send autotuning has been disabled
|
||||
uint32_t mSetTCPSocketBuffer : 1;
|
||||
|
||||
// The InlineFrame and associated data is used for composing control
|
||||
// frames and data frame headers.
|
||||
nsAutoArrayPtr<char> mTxInlineFrame;
|
||||
|
@ -174,7 +174,6 @@ nsHttpHandler::nsHttpHandler()
|
||||
, mCoalesceSpdy(true)
|
||||
, mUseAlternateProtocol(false)
|
||||
, mSpdySendingChunkSize(ASpdySession::kSendingChunkSize)
|
||||
, mSpdySendBufferSize(ASpdySession::kTCPSendBufferSize)
|
||||
, mSpdyPingThreshold(PR_SecondsToInterval(44))
|
||||
, mSpdyPingTimeout(PR_SecondsToInterval(8))
|
||||
, mConnectTimeout(90000)
|
||||
@ -1104,14 +1103,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
||||
PR_SecondsToInterval((uint16_t) clamped(val, 0, 0x7fffffff));
|
||||
}
|
||||
|
||||
// The amount of seconds to wait for a spdy ping response before
|
||||
// closing the session.
|
||||
if (PREF_CHANGED(HTTP_PREF("spdy.send-buffer-size"))) {
|
||||
rv = prefs->GetIntPref(HTTP_PREF("spdy.send-buffer-size"), &val);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
mSpdySendBufferSize = (uint32_t) clamped(val, 1500, 0x7fffffff);
|
||||
}
|
||||
|
||||
// The maximum amount of time to wait for socket transport to be
|
||||
// established
|
||||
if (PREF_CHANGED(HTTP_PREF("connection-timeout"))) {
|
||||
|
@ -93,7 +93,6 @@ public:
|
||||
bool CoalesceSpdy() { return mCoalesceSpdy; }
|
||||
bool UseAlternateProtocol() { return mUseAlternateProtocol; }
|
||||
uint32_t SpdySendingChunkSize() { return mSpdySendingChunkSize; }
|
||||
uint32_t SpdySendBufferSize() { return mSpdySendBufferSize; }
|
||||
PRIntervalTime SpdyPingThreshold() { return mSpdyPingThreshold; }
|
||||
PRIntervalTime SpdyPingTimeout() { return mSpdyPingTimeout; }
|
||||
uint32_t ConnectTimeout() { return mConnectTimeout; }
|
||||
@ -375,7 +374,6 @@ private:
|
||||
bool mCoalesceSpdy;
|
||||
bool mUseAlternateProtocol;
|
||||
uint32_t mSpdySendingChunkSize;
|
||||
uint32_t mSpdySendBufferSize;
|
||||
PRIntervalTime mSpdyPingThreshold;
|
||||
PRIntervalTime mSpdyPingTimeout;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user