[webkit-qt] Buffer problem with my WebKit/NPAPI patch?

Garth Dahlstrom ironstorm at gmail.com
Thu Mar 25 23:46:11 PDT 2010


As I work towards adding Java applet support (#33044) to webkit through implementing the missing NPAPI hooks for passing proxy and cookie values (#34539)... 

I've hit a bit of a bump in the road.    It looks like some corruption is happening in the NPAPI "get value" method for cookies (NPN_GetValueForURL).

This is not seen in the debug statements of either implementation from the Qt app (this patch provides to functionally identical implementations in Qt and pure WebKit) but is observed as occasional extra junk being appended to the end of the Java cookies in the debug console, sometimes it indicates a cookie value is returned when there is no value supposed to be returned.   

Hosting test browser app:
> [2960] npapi.cpp - NPN_GetValueForURL::  Proxy url: http://www.javatester.org:80/
> [2960] npapi.cpp - NPN_GetValueForURL::Proxy fetching Proxy from Qt 
> [2960] npapi.cpp - NPN_GetValueForURL::Proxy  DIRECT 
> [2960] npapi.cpp - NPN_GetValueForURL::  Cookie url:  http://www.javatester.org/JavaVersionDisplayApplet.class
> [2960] npapi.cpp - NPN_GetValueForURL::Cookies [  ] Length: 0 
> [2960] len is set before:  0x28d20c 
> [2960] len is set after:  0x28d20c 
> [2960] len is:  0 

Java Console:
> Java Plug-in 1.6.0_17
> Using JRE version 1.6.0_17-b04 Java HotSpot(TM) Client VM
> ...
> security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
> basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener at b166b5
> network: Cache entry found [url: http://www.javatester.org/JavaVersionDisplayApplet.class, version: null]
> network: Connecting http://www.javatester.org/JavaVersionDisplayApplet.class with proxy=DIRECT
> network: Connecting http://www.javatester.org:80/ with proxy=DIRECT
>> network: Connecting http://www.javatester.org/JavaVersionDisplayApplet.class with cookie "°REC"   <--- This is junk since there is no value returned from the host Qt app as far as I can tell.
> ...

I suspect the problem is something to do with the statements in the IF block at line 36 of the attached patch, however I'm unable to figure out what's happening (I've tried to implement it 2 ways, results are the same)...   

Not very good at low level C/C++, which is why I use Qt for native compiled apps...  Maybe I'm doing something obviously wrong (i.e. does the length pointer thing look okay)?

If someone could take a look at it and tell me if they spot anything I'd be grateful.

Cheers,

-G

-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtwebkit-gecko-npapi-v1.9-partial-20100325.patch
Type: application/octet-stream
Size: 7905 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20100326/5dd7af2e/attachment.obj>


More information about the webkit-qt mailing list