mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 06:38:36 +00:00
Backout changeset f397877da0dd, a=backout
This commit is contained in:
parent
4449e81d18
commit
44943a56b7
@ -1778,20 +1778,9 @@ nsSocketTransport::GetSecurityCallbacks(nsIInterfaceRequestor **callbacks)
|
||||
NS_IMETHODIMP
|
||||
nsSocketTransport::SetSecurityCallbacks(nsIInterfaceRequestor *callbacks)
|
||||
{
|
||||
nsCOMPtr<nsISupports> secinfo;
|
||||
{
|
||||
nsAutoLock lock(mLock);
|
||||
mCallbacks = callbacks;
|
||||
SOCKET_LOG(("Reset callbacks for secinfo=%p callbacks=%p\n", mSecInfo.get(), mCallbacks.get()));
|
||||
|
||||
secinfo = mSecInfo;
|
||||
}
|
||||
|
||||
// don't call into PSM while holding mLock!!
|
||||
nsCOMPtr<nsISSLSocketControl> secCtrl(do_QueryInterface(secinfo));
|
||||
if (secCtrl)
|
||||
secCtrl->SetNotificationCallbacks(callbacks);
|
||||
|
||||
nsAutoLock lock(mLock);
|
||||
mCallbacks = callbacks;
|
||||
// XXX should we tell PSM about this?
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,6 @@ nsHttpConnection::nsHttpConnection()
|
||||
, mSupportsPipelining(PR_FALSE) // assume low-grade server
|
||||
, mIsReused(PR_FALSE)
|
||||
, mCompletedSSLConnect(PR_FALSE)
|
||||
, mResetCallbackOnActivation(PR_FALSE)
|
||||
, mActivationCount(0)
|
||||
{
|
||||
LOG(("Creating nsHttpConnection @%x\n", this));
|
||||
@ -111,6 +110,7 @@ nsHttpConnection::~nsHttpConnection()
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(mConnInfo);
|
||||
NS_IF_RELEASE(mTransaction);
|
||||
|
||||
if (mLock) {
|
||||
PR_DestroyLock(mLock);
|
||||
@ -193,19 +193,10 @@ nsHttpConnection::Activate(nsAHttpTransaction *trans, PRUint8 caps)
|
||||
NS_ENSURE_TRUE(!mTransaction, NS_ERROR_IN_PROGRESS);
|
||||
|
||||
// take ownership of the transaction
|
||||
mTransactionReference = trans;
|
||||
mTransaction = trans;
|
||||
NS_ADDREF(mTransaction);
|
||||
mActivationCount++;
|
||||
|
||||
if (mResetCallbackOnActivation) {
|
||||
mResetCallbackOnActivation = PR_FALSE;
|
||||
|
||||
rv = mSocketTransport->SetEventSink(this, nsnull);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = mSocketTransport->SetSecurityCallbacks(this);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// set mKeepAlive according to what will be requested
|
||||
mKeepAliveMask = mKeepAlive = (caps & NS_HTTP_ALLOW_KEEPALIVE);
|
||||
|
||||
@ -235,10 +226,8 @@ nsHttpConnection::Activate(nsAHttpTransaction *trans, PRUint8 caps)
|
||||
}
|
||||
|
||||
failed_activation:
|
||||
if (NS_FAILED(rv)) {
|
||||
mTransaction = nsnull;
|
||||
mTransactionReference = nsnull;
|
||||
}
|
||||
if (NS_FAILED(rv))
|
||||
NS_RELEASE(mTransaction);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -659,8 +648,10 @@ nsHttpConnection::AssignTransport(nsISocketTransport *sock,
|
||||
nsIAsyncOutputStream *outs,
|
||||
nsIAsyncInputStream *ins)
|
||||
{
|
||||
mResetCallbackOnActivation = PR_TRUE;
|
||||
|
||||
nsresult rv = sock->SetEventSink(this, nsnull);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv =sock->SetSecurityCallbacks(this);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mSocketTransport = sock;
|
||||
mSocketOut = outs;
|
||||
mSocketIn = ins;
|
||||
@ -681,7 +672,9 @@ nsHttpConnection::CloseTransaction(nsAHttpTransaction *trans, nsresult reason)
|
||||
reason = NS_OK;
|
||||
|
||||
mTransaction->Close(reason);
|
||||
mTransaction = nsnull;
|
||||
|
||||
NS_RELEASE(mTransaction);
|
||||
mTransaction = 0;
|
||||
|
||||
if (NS_FAILED(reason))
|
||||
Close(reason);
|
||||
@ -937,9 +930,6 @@ nsHttpConnection::ReleaseBackupTransport(nsISocketTransport *sock,
|
||||
void
|
||||
nsHttpConnection::SelectPrimaryTransport(nsIAsyncOutputStream *out)
|
||||
{
|
||||
LOG(("nsHttpConnection::SelectPrimaryTransport(out=%p), mSocketOut1=%p, mSocketOut2=%p, mSocketOut=%p",
|
||||
out, mSocketOut1.get(), mSocketOut2.get(), mSocketOut.get()));
|
||||
|
||||
if (!mSocketOut) {
|
||||
// Setup the Main Socket
|
||||
|
||||
@ -1040,18 +1030,18 @@ nsHttpConnection::OnOutputStreamReady(nsIAsyncOutputStream *out)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(PR_GetCurrentThread() == gSocketThread, "wrong thread");
|
||||
|
||||
NS_ABORT_IF_FALSE(out == mSocketOut ||
|
||||
out == mSocketOut1 ||
|
||||
out == mSocketOut2 , "unexpected socket");
|
||||
if (out != mSocketOut)
|
||||
SelectPrimaryTransport(out);
|
||||
|
||||
// if the transaction was dropped...
|
||||
if (!mTransaction) {
|
||||
LOG((" no transaction; ignoring event\n"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_ABORT_IF_FALSE(out == mSocketOut ||
|
||||
out == mSocketOut1 ||
|
||||
out == mSocketOut2 , "unexpected socket");
|
||||
if (out != mSocketOut)
|
||||
SelectPrimaryTransport(out);
|
||||
|
||||
if (mSocketOut == out) {
|
||||
NS_ABORT_IF_FALSE(!mIdleSynTimer,"IdleSynTimer should not be set");
|
||||
nsresult rv = OnSocketWritable();
|
||||
@ -1091,9 +1081,9 @@ nsHttpConnection::GetInterface(const nsIID &iid, void **result)
|
||||
// part-way through this function call. See CloseTransaction.
|
||||
NS_ASSERTION(PR_GetCurrentThread() != gSocketThread, "wrong thread");
|
||||
|
||||
if (mTransactionReference) {
|
||||
if (mTransaction) {
|
||||
nsCOMPtr<nsIInterfaceRequestor> callbacks;
|
||||
mTransactionReference->GetSecurityCallbacks(getter_AddRefs(callbacks));
|
||||
mTransaction->GetSecurityCallbacks(getter_AddRefs(callbacks));
|
||||
if (callbacks)
|
||||
return callbacks->GetInterface(iid, result);
|
||||
}
|
||||
|
@ -165,9 +165,6 @@ private:
|
||||
nsCOMPtr<nsIInputStream> mSSLProxyConnectStream;
|
||||
nsCOMPtr<nsIInputStream> mRequestStream;
|
||||
|
||||
// mTransaction only points to mTransactionReference if the
|
||||
// transaction is open, otherwise it is null.
|
||||
nsRefPtr<nsAHttpTransaction> mTransactionReference;
|
||||
nsAHttpTransaction *mTransaction; // hard ref
|
||||
nsHttpConnectionInfo *mConnInfo; // hard ref
|
||||
|
||||
@ -182,7 +179,6 @@ private:
|
||||
PRPackedBool mSupportsPipelining;
|
||||
PRPackedBool mIsReused;
|
||||
PRPackedBool mCompletedSSLConnect;
|
||||
PRPackedBool mResetCallbackOnActivation;
|
||||
|
||||
PRUint32 mActivationCount;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user