Bug 804237, r=biesi

This commit is contained in:
Honza Bambas 2012-10-31 22:17:29 +01:00
parent e2817d88c5
commit 2a9f1c08e2

View File

@ -78,6 +78,7 @@ public:
PRStatus DoHandshake(PRFileDesc *fd, int16_t oflags = -1);
int16_t GetPollFlags() const;
bool IsConnected() const { return mState == SOCKS_CONNECTED; }
void ForgetFD() { mFD = nullptr; }
private:
void HandshakeFinished(PRErrorCode err = 0);
@ -273,8 +274,10 @@ nsSOCKSSocketInfo::OnLookupComplete(nsICancelable *aRequest,
mLookupStatus = aStatus;
mDnsRec = aRecord;
mState = SOCKS_DNS_COMPLETE;
ConnectToProxy(mFD);
mFD = nullptr;
if (mFD) {
ConnectToProxy(mFD);
ForgetFD();
}
return NS_OK;
}
@ -1125,6 +1128,7 @@ nsSOCKSIOLayerClose(PRFileDesc *fd)
if (info && id == nsSOCKSIOLayerIdentity)
{
info->ForgetFD();
NS_RELEASE(info);
fd->identity = PR_INVALID_IO_LAYER;
}