fixes bug 193917 "incorporate changes from bz's comments in bug 176919" r+sr=bzbarsky

git-svn-id: svn://10.0.0.236/trunk@147780 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%meer.net
2003-10-09 01:54:07 +00:00
parent 49e6d5cfc2
commit aa4dd41e45
17 changed files with 249 additions and 40 deletions

View File

@@ -283,6 +283,8 @@ nsInputStreamChannel::Open(nsIInputStream **result)
NS_ENSURE_TRUE(mContentStream, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(!mPump, NS_ERROR_IN_PROGRESS);
// XXX this won't work if mContentStream is non-blocking.
NS_ADDREF(*result = mContentStream);
return NS_OK;
}
@@ -293,6 +295,11 @@ nsInputStreamChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt)
NS_ENSURE_TRUE(mContentStream, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(!mPump, NS_ERROR_IN_PROGRESS);
// if content length is unknown, then we must guess... in this case, we
// assume the stream can tell us. if the stream is a pipe, then this will
// not work. in that case, we hope that the user of this interface would
// have set our content length to PR_UINT32_MAX to cause us to read until
// end of stream.
if (mContentLength == -1)
mContentStream->Available((PRUint32 *) &mContentLength);