зеркало из https://github.com/mozilla/pjs.git
Fixed bug where file transport would spin if it failed in the nsIFileSystem::Open method. Affected jar protocol.
This commit is contained in:
Родитель
562bcab6b2
Коммит
688ffa434f
|
@ -702,26 +702,18 @@ nsFileTransport::Process(void)
|
|||
("nsFileTransport: OPENING [this=%x %s]",
|
||||
this, (const char*)mSpec));
|
||||
mStatus = mFileObject->Open(&mContentType, &mTotalAmount);
|
||||
if (NS_FAILED(mStatus)) {
|
||||
mState = CLOSING;
|
||||
return;
|
||||
}
|
||||
if (mOpenObserver) {
|
||||
if (NS_SUCCEEDED(mStatus) && mOpenObserver) {
|
||||
mStatus = mOpenObserver->OnStartRequest(this, mOpenContext);
|
||||
if (NS_FAILED(mStatus)) {
|
||||
mState = CLOSING;
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch (mCommand) {
|
||||
case INITIATE_READ:
|
||||
mState = START_READ;
|
||||
mState = NS_FAILED(mStatus) ? END_READ : START_READ;
|
||||
break;
|
||||
case INITIATE_WRITE:
|
||||
mState = START_WRITE;
|
||||
mState = NS_FAILED(mStatus) ? END_WRITE : START_WRITE;
|
||||
break;
|
||||
default:
|
||||
mState = OPENED;
|
||||
mState = NS_FAILED(mStatus) ? CLOSING : OPENED;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -857,7 +849,7 @@ nsFileTransport::Process(void)
|
|||
}
|
||||
mContext = null_nsCOMPtr();
|
||||
|
||||
mState = OPENED; // stay in the opened state for the next read/write request
|
||||
mState = NS_FAILED(mStatus) ? CLOSING : OPENED; // stay in the opened state for the next read/write request
|
||||
mCommand = NONE;
|
||||
break;
|
||||
}
|
||||
|
@ -995,7 +987,7 @@ nsFileTransport::Process(void)
|
|||
}
|
||||
mContext = null_nsCOMPtr();
|
||||
|
||||
mState = OPENED; // stay in the opened state for the next read/write request
|
||||
mState = NS_FAILED(mStatus) ? CLOSING : OPENED; // stay in the opened state for the next read/write request
|
||||
mCommand = NONE;
|
||||
break;
|
||||
}
|
||||
|
@ -1016,6 +1008,7 @@ nsFileTransport::Process(void)
|
|||
NS_ASSERTION(NS_SUCCEEDED(rv), "unexpected Close failure");
|
||||
mFileObject = null_nsCOMPtr();
|
||||
}
|
||||
mState = CLOSED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче