fixes bug 191227 "file uploads hang (especially w/ slower connections or

slower servers)" r=dougt sr=bz a=dbaron


git-svn-id: svn://10.0.0.236/trunk@137175 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%netscape.com
2003-01-31 02:00:45 +00:00
parent 13bdad253d
commit 979608deea
6 changed files with 26 additions and 10 deletions

View File

@@ -83,7 +83,6 @@ nsByteArrayInputStream::Read (char* aBuffer, PRUint32 aCount, PRUint32 *aNumRead
NS_IMETHODIMP
nsByteArrayInputStream::ReadSegments(nsWriteSegmentFun writer, void * aClosure, PRUint32 aCount, PRUint32 *aNumRead)
{
nsresult rv = NS_OK;
if (aNumRead == NULL)
return NS_ERROR_NULL_POINTER;
@@ -97,14 +96,16 @@ nsByteArrayInputStream::ReadSegments(nsWriteSegmentFun writer, void * aClosure,
PRUint32 readCount = PR_MIN(aCount, (_nbytes - _pos));
if (_buffer == NULL)
*aNumRead = 0;
else
rv = writer (this, aClosure, &_buffer[_pos],
_pos, readCount, aNumRead);
_pos += *aNumRead;
else {
nsresult rv = writer (this, aClosure, &_buffer[_pos],
_pos, readCount, aNumRead);
if (NS_SUCCEEDED(rv))
_pos += *aNumRead;
}
}
return rv;
// do not propogate errors returned from writer!
return NS_OK;
}
NS_IMETHODIMP