Fix for bug 157157. Always use nsInputStreamTee objects for streaming plugin data. r=beard

git-svn-id: svn://10.0.0.236/branches/CHIMERA_M1_0_1_BRANCH@130155 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bnesse%netscape.com
2002-09-20 17:04:25 +00:00
parent 5c97461a8a
commit 5a70261fd5

View File

@@ -2292,19 +2292,16 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIRequest *request,
mPluginStreamInfo->SetStreamOffset(absoluteOffset + amtForwardToPlugin);
}
nsCOMPtr<nsIInputStream> stream = aIStream;
// if we are caching the file ourselves to disk, we want to 'tee' off
// the data as the plugin read from the stream. We do this by the magic
// of an input stream tee.
nsCOMPtr<nsIInputStream> stream;
nsCOMPtr<nsIOutputStream> outStream;
mPluginStreamInfo->GetLocalCachedFileStream(getter_AddRefs(outStream));
if (outStream) {
rv = NS_NewInputStreamTee(getter_AddRefs(stream), aIStream, outStream);
if (NS_FAILED(rv))
return rv;
}
rv = NS_NewInputStreamTee(getter_AddRefs(stream), aIStream, outStream);
if (NS_FAILED(rv))
return rv;
rv = mPStreamListener->OnDataAvailable((nsIPluginStreamInfo*)mPluginStreamInfo,
stream,