modifications for bug 176919 "async streams" r=dougt,gordon sr=sspitzer a=valeski,asa

git-svn-id: svn://10.0.0.236/trunk@136572 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
darin%netscape.com
2003-01-18 02:15:14 +00:00
parent 0b0de85fee
commit 2b1d90b6ed
172 changed files with 7238 additions and 9820 deletions

View File

@@ -85,6 +85,8 @@ nsInputStreamTee::TeeSegment(const char *buf, PRUint32 count)
// ok, this is not a fatal error... just drop our reference to mSink
// and continue on as if nothing happened.
NS_WARNING("Write failed (non-fatal)");
// catch possible misuse of the input stream tee
NS_ASSERTION(rv != NS_BASE_STREAM_WOULD_BLOCK, "sink must be a blocking stream");
mSink = 0;
break;
}
@@ -181,16 +183,6 @@ nsInputStreamTee::GetSource(nsIInputStream **source)
NS_IMETHODIMP
nsInputStreamTee::SetSink(nsIOutputStream *sink)
{
if (sink) {
PRBool nonBlocking = PR_FALSE;
nsresult rv = sink->IsNonBlocking(&nonBlocking);
if (NS_FAILED(rv))
return rv;
if (nonBlocking) {
NS_NOTREACHED("Can only tee data to a blocking output stream");
return NS_ERROR_NOT_IMPLEMENTED;
}
}
mSink = sink;
return NS_OK;
}