From 63446c50772dd349589754e83b7985052b6f51c4 Mon Sep 17 00:00:00 2001 From: "serge%netscape.com" Date: Mon, 22 Apr 2002 01:08:27 +0000 Subject: [PATCH] fix for #131153, PDF plugin doesn't work, it expects file extension for stream type == StreamType_AsFile; r=peterl, sr=beard git-svn-id: svn://10.0.0.236/trunk@119526 18797224-902f-48f8-a5cc-f745e15eee43 --- .../modules/plugin/base/src/nsPluginHostImpl.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp index 28a55cb692f..a4ac35381aa 100644 --- a/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -2483,6 +2483,21 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request, if (NS_SUCCEEDED(rv)) { mPStreamListener->GetStreamType(&mStreamType); + // if plugin requests stream type StreamType_AsFile or StreamType_AsFileOnly + // most likely it'll try to check file extension, + // but our cache does nor support it yet. + // temp fix is to copy the file+ext into temp location + // all this code should be deleted when bug 90558 got fixed +#if !defined(CACHE_SUPPOPTS_FILE_EXTENSION) + if (mStreamType >= nsPluginStreamType_AsFile && httpChannel) { + // check out if we already set output stream for this channel + nsCOMPtr outStream; + mPluginStreamInfo->GetLocalCachedFileStream(getter_AddRefs(outStream)); + if (!outStream) { + SetupPluginCacheFile(httpChannel); + } + } +#endif } return rv;