Closed Bug 49525 Opened 24 years ago Closed 24 years ago

No way for plugins to set headers to HTTP GET

Categories

(Core Graveyard :: Plug-ins, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: edburns, Assigned: xiaobin.lu)

References

Details

Attachments

(8 files)

nsIPluginManager::GetURL() has no arguments for sending headers to the GET
request.

http://lxr.mozilla.org/mozilla/source/modules/plugin/public/nsIPluginManager.h#132.
Depends on: 49522
a
Status: NEW → ASSIGNED
Hope that there is no objection that I am reassigning this bug to 
Xiao Bin per Ed Burn's request.
Assignee: edburns → xiaobin.lu
Status: ASSIGNED → NEW
cvs -n update (in directory E:\PROJECTS\MOZILLA\MODULES\PLUGIN)
cvs server: Updating .
cvs server: Updating SanePlugin
cvs server: Updating SanePlugin/test
cvs server: Updating bad
cvs server: Updating default
cvs server: Updating default/windows
cvs server: Updating macbuild
cvs server: Updating mpdk
cvs server: Updating mpdk/basic
cvs server: Updating mpdk/basic/common
cvs server: Updating mpdk/basic/include
cvs server: Updating mpdk/basic/windows
cvs server: Updating mpdk/mozilla
cvs server: Updating nglsrc
M nglsrc/nsPluginHostImpl.cpp
M nglsrc/nsPluginHostImpl.h
cvs server: Updating public
M public/nsIPluginManager.h
cvs server: Updating src
M src/npglue.h
M src/nsPluginManager.cpp
M src/nsPluginManager.h
M src/nsplugin.cpp
cvs server: Updating test
cvs server: Updating test/samples
Attached patch cvs diff -uSplinter Review
Attached patch cvs diffSplinter Review
I hope it is not too late to put this thing here. 
Hi Xiaobin,

1. when posting the output of cvs -n update please PRUNE the output so
   it only contains lines like

M nglsrc/nsPluginHostImpl.cpp
A public/newfile.idl

and DOES NOT contain lines like: 

cvs server: Updating mpdk/basic

2.

+
+
 NS_IMETHODIMP nsPluginHostImpl::PostURL(nsISupports* pluginInst,
 									
	const char* url,
 									
	PRUint32 postDataLen, 
@@ -3360,7 +3366,8 @@
   rv = cookieService->GetCookieString(uriIn, cookieString);
   
   if (NS_FAILED(rv) || 
-      (((PRInt32) inOutCookieSize) < cookieString.Length())) {
+     // (((PRInt32) inOutCookieSize) < cookieString.Length())) {
+	 (inOutCookieSize < cookieString.Length())) {
     return NS_ERROR_FAILURE;
   

Why did you comment out that line?  Is this from the file not being
current with the tip?

3. You don't need to modify any files in modules\plugin\src.  That
directory isn't used any more.

Other than that, r=edburns.  You need to ask Andrei Volkov
<av@netscape.com> for review and approval as well.  Please send him a
mail and CC me.

Make the subject be something like: Need review and approval for bug 49525.

Ed
Status: NEW → ASSIGNED
cvs -n update
M nglsrc/nsPluginHostImpl.cpp
M nglsrc/nsPluginHostImpl.h
M public/nsIPluginManager.h
Attached patch cvs diff -uSplinter Review
I have removed the modified files from src directory. 
Igor, this fix adds a method to nsIPluginManager.h, so I think it'll break:

java/plugins/jni/org_mozilla_pluglet_mozilla_PlugletManagerImpl.cpp
This simple fix just adds parameters to an existing method in an XPCOM
safe way, by defining a new method at the end of the interface
definition with the additional parameters.

Original method:

    NS_IMETHOD
    GetURL(nsISupports* pluginInst, 
           const char* url, 
           const char* target = NULL,
           nsIPluginStreamListener* streamListener = NULL,
           const char* altHost = NULL,
           const char* referrer = NULL,
           PRBool forceJSEnabled = PR_FALSE) = 0;

New method:

    NS_IMETHOD
    GetURLWithHeaders(nsISupports* pluginInst, 
                      const char* url, 
                      const char* target = NULL,
                      nsIPluginStreamListener* streamListener = NULL,
                      const char* altHost = NULL,
                      const char* referrer = NULL,
                      PRBool forceJSEnabled = PR_FALSE,
                      PRUint32 getHeadersLength = 0, 
                      const char* getHeaders = NULL) = 0;

I have modified nsPluginHostImpl.h to include this new method, and
modified nsPluginHostImpl.cpp so that its GetURL calls GetURLWithHeaders
with null values for the last two params.

M modules/plugin/public/nsIPluginManager.h
M modules/plugin/nglsrc/nsPluginHostImpl.cpp
M modules/plugin/nglsrc/nsPluginHostImpl.h

Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Fix checked in.
spam : marking verified
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: