Closed Bug 518475 Opened 16 years ago Closed 8 years ago

NPN_RequestRead fails with multiple byte ranges

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: jgriffin, Unassigned)

References

Details

When a plugin calls NPN_RequestRead and passes it a single byte range, the browser makes the appropriate request and calls NPP_Write as expected. However, if the plugin calls NPN_RequestRead with two ranges in the rangeList parameter, the browser returns NPERR_NO_ERROR but never calls NPP_Write. By turning on http logging I can see that the browser does in fact make the correct HTTP request and receive a response, but for some reason this is never tranlasted into any NPP_Write calls to the plugin. To reproduce the passing case, you can load the following page: http://people.mozilla.org/~jgriffin/npn_requestread/test_good.html Note that when the passing case is run, the plugin populates the iframe with text, and produces the following debug output: For application/x-test found plugin nptest.dll NPP_NewStream NPP_Write, offset=0, len=1024, end=3976 NPP_Write, offset=1024, len=1024, end=3976 NPP_Write, offset=2048, len=1024, end=3976 NPP_Write, offset=3072, len=904, end=3976 called NPN_RequestRead, return 0 NPP_Write, offset=100, len=100, end=3976 data matches! It's the last NPP_Write call which was generated by the call to NPN_RequestRead, as the range passed to it was 100,100. To reproduce the failing case, load the following page: http://people.mozilla.org/~jgriffin/npn_requestread/test_fail.html In this case, the iframe is never populated with data, and the debug output is: For application/x-test found plugin nptest.dll NPP_NewStream NPP_Write, offset=0, len=1024, end=3976 NPP_Write, offset=1024, len=1024, end=3976 NPP_Write, offset=2048, len=1024, end=3976 NPP_Write, offset=3072, len=904, end=3976 called NPN_RequestRead, return 0 NPN_Write is never called following the call to NPN_RequestRead. The call to NPN_RequestRead was made with two ranges in this case, 100,100 and 500,100.
Perhaps NPN_RequestRead is being ignored because that data was already delivered? Typically NPN_RequestRead is called immediately from NPP_NewStream, which cancels the normal 'deliver all the content' behavior, I think...
Well, there is some uncertainty in the docs as to when NPN_RequestRead may be called. All attempts I have made at calling it within NPP_NewStream always return NPERR_STREAM_NOT_SEEKABLE, even for nice seekable http streams. Do you think this is a bug? I also tried calling it from the first NPP_Write call (before the entire stream is consumed), but this results in the same behavior as the original description.
Resolving old bugs which are likely not relevant any more, since NPAPI plugins are deprecated.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.