fixes bug 189897 "Download starts with Download Error, then Cancel Button disabled"

r=adamlock sr=bzbarsky a=dbaron


git-svn-id: svn://10.0.0.236/trunk@136918 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%netscape.com
2003-01-24 00:53:00 +00:00
parent aa108a4dc4
commit 09833d8405
4 changed files with 11 additions and 4 deletions

View File

@@ -899,6 +899,7 @@ NS_IMETHODIMP nsWebBrowserPersist::OnStatus(
case NS_NET_STATUS_CONNECTED_TO:
case NS_NET_STATUS_SENDING_TO:
case NS_NET_STATUS_RECEIVING_FROM:
case NS_NET_STATUS_WAITING_FOR:
break;
default:

View File

@@ -109,4 +109,5 @@ interface nsISocketTransport : nsITransport
#define NS_NET_STATUS_SENDING_TO nsISocketTransport::STATUS_SENDING_TO
#define NS_NET_STATUS_RECEIVING_FROM nsISocketTransport::STATUS_RECEIVING_FROM
#define NS_NET_STATUS_CONNECTING_TO nsISocketTransport::STATUS_CONNECTING_TO
#define NS_NET_STATUS_WAITING_FOR nsISocketTransport::STATUS_WAITING_FOR
%}

View File

@@ -3050,7 +3050,8 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status,
{
// block socket status event after OnStopRequest has been fired.
if (mProgressSink && mIsPending && !(mLoadFlags & LOAD_BACKGROUND)) {
LOG(("sending status notification [status=%x]\n", status));
LOG(("sending status notification [this=%x status=%x progress=%u/%u]\n",
this, status, progress, progressMax));
NS_ConvertASCIItoUCS2 host(mConnectionInfo->Host());
mProgressSink->OnStatus(this, nsnull, status, host.get());
@@ -3063,8 +3064,8 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status,
}
#ifdef DEBUG
else
LOG(("skipping status notification [sink=%x pending=%u background=%x]\n",
mProgressSink.get(), mIsPending, (mLoadFlags & LOAD_BACKGROUND)));
LOG(("skipping status notification [this=%x sink=%x pending=%u background=%x]\n",
this, mProgressSink.get(), mIsPending, (mLoadFlags & LOAD_BACKGROUND)));
#endif
return NS_OK;

View File

@@ -271,12 +271,16 @@ nsHttpTransaction::OnTransportStatus(nsresult status, PRUint32 progress)
mTransportProgress = mContentRead;
mTransportProgressMax = mContentLength;
}
else {
else if (status == nsISocketTransport::STATUS_SENDING_TO) {
// when uploading, we include the request headers in the progress
// notifications.
mTransportProgress = progress;
mTransportProgressMax = mRequestSize;
}
else {
mTransportProgress = 0;
mTransportProgressMax = 0;
}
postEvent = !mTransportStatusInProgress;
}