From 4fdc8f5ef0454deb7f9fdca3d4334e633cf975ec Mon Sep 17 00:00:00 2001 From: "av%netscape.com" Date: Wed, 2 Jan 2002 22:04:04 +0000 Subject: [PATCH] Bug 17732 -- plugin invoked streams to the browser do not work, r=peterl, sr=rpotts git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@111252 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/plugin/base/src/ns4xPlugin.cpp | 7 ++++++- mozilla/modules/plugin/base/src/nsPluginInstancePeer.cpp | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp index 05038c168f6..0a8053f87e0 100644 --- a/mozilla/modules/plugin/base/src/ns4xPlugin.cpp +++ b/mozilla/modules/plugin/base/src/ns4xPlugin.cpp @@ -723,8 +723,11 @@ _posturl(NPP npp, // A little helper class used to wrap up plugin manager streams (that is, // streams from the plugin to the browser). -class ns4xStreamWrapper +class ns4xStreamWrapper : public nsISupports { +public: + NS_DECL_ISUPPORTS + protected: nsIOutputStream *fStream; NPStream fNPStream; @@ -741,6 +744,8 @@ public: }; }; +NS_IMPL_ISUPPORTS1(ns4xStreamWrapper, nsISupports); + ns4xStreamWrapper::ns4xStreamWrapper(nsIOutputStream* stream) : fStream(stream) { diff --git a/mozilla/modules/plugin/base/src/nsPluginInstancePeer.cpp b/mozilla/modules/plugin/base/src/nsPluginInstancePeer.cpp index 651ed469fbd..b435bd36301 100644 --- a/mozilla/modules/plugin/base/src/nsPluginInstancePeer.cpp +++ b/mozilla/modules/plugin/base/src/nsPluginInstancePeer.cpp @@ -207,7 +207,7 @@ nsPluginStreamToFile::nsPluginStreamToFile(const char* target, nsIPluginInstance tpath[0] = 0; #endif // XP_PC - PR_snprintf(buf, sizeof(buf), "%s%08X.html", tpath, this); + PR_snprintf(buf, sizeof(buf), "%s%08X", tpath, this); // Create and validate the file spec object. (When we have a constructor for the temp @@ -270,7 +270,7 @@ nsPluginStreamToFile::Write(const char* aBuf, PRUint32 aCount, PRUint32 *aWriteC // write the data to the file and update the target nsCOMPtr thing; thing = do_QueryInterface(mFileThing); - thing->Open(mFileSpec, (PR_RDWR|PR_APPEND), 0700); + thing->Open(mFileSpec, (PR_WRONLY | PR_CREATE_FILE | PR_APPEND), 0700); PRUint32 actualCount; mFileThing->Write(aBuf, aCount, &actualCount); mFileThing->Close();