зеркало из https://github.com/mozilla/gecko-dev.git
Bug 426060: handle the possibility that both mHostRecord->addr_info and mHostRecord->addr are null if the old mHostRecord->addr_info exired and our attempt to reresolve it failed. r=jst, sr=cbiesinger blocking1.9+ Modified Files: nsDNSService2.cpp nsHostResolver.cpp
This commit is contained in:
Родитель
02405842a2
Коммит
16387d0038
|
@ -137,7 +137,12 @@ nsDNSRecord::GetNextAddr(PRUint16 port, PRNetAddr *addr)
|
|||
}
|
||||
else {
|
||||
PR_Unlock(mHostRecord->addr_info_lock);
|
||||
NS_ASSERTION(mHostRecord->addr, "no addr");
|
||||
if (!mHostRecord->addr) {
|
||||
// Both mHostRecord->addr_info and mHostRecord->addr are null.
|
||||
// This can happen if mHostRecord->addr_info expired and the
|
||||
// attempt to reresolve it failed.
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
memcpy(addr, mHostRecord->addr, sizeof(PRNetAddr));
|
||||
// set given port
|
||||
port = PR_htons(port);
|
||||
|
|
|
@ -637,7 +637,9 @@ nsHostResolver::OnLookupComplete(nsHostRecord *rec, nsresult status, PRAddrInfo
|
|||
PR_Unlock(rec->addr_info_lock);
|
||||
if (old_addr_info)
|
||||
PR_FreeAddrInfo(old_addr_info);
|
||||
rec->expiration = NowInMinutes() + mMaxCacheLifetime;
|
||||
rec->expiration = NowInMinutes();
|
||||
if (result)
|
||||
rec->expiration += mMaxCacheLifetime;
|
||||
rec->resolving = PR_FALSE;
|
||||
|
||||
if (rec->addr_info && !mShutdown) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче