Plugin can not access some cache content via NP_ASFILEONLY

RESOLVED DUPLICATE of bug 723100

Status

()

Core
Networking: Cache
RESOLVED DUPLICATE of bug 723100
6 years ago
6 years ago

People

(Reporter: Martin Husemann, Unassigned)

Tracking

Trunk
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
I have a scriptable plugin that requests URLs GetURLNotify() and sets *stype to NP_ASFILEONLY in the NewStream callback.

Sometimes this calls do not get any data delivered (as a file), but the stream just is closed.

This is a stack trace of, what I believe, happens:

xul.dll!nsDiskCacheDevice::GetFileForEntry(nsCacheEntry * entry=0x0801b138, nsIFile * * result=0x0012d8d8)  Line 832
xul.dll!nsCacheService::GetFileForEntry(nsCacheEntry * entry=0x0801b138, nsIFile * * result=0x0012d8d8)  Line 2392
xul.dll!nsCacheEntryDescriptor::GetFile(nsIFile * * result=0x0012d8d8)  Line 427 + 0x9 bytes
xul.dll!nsHttpChannel::GetCacheFile(nsIFile * * cacheFile=0x0012d8d8)  Line 4938
xul.dll!nsPluginStreamListenerPeer::OnStopRequest(nsIRequest * request=0x0801f444, nsISupports * aContext=0x00000000, unsigned int aStatus=0)  Line 1082 + 0x2e bytes
xul.dll!nsHttpChannel::OnStopRequest(nsIRequest * request=0x0801f444, nsISupports * ctxt=0x00000000, unsigned int status=0)  Line 4508
xul.dll!nsInputStreamPump::OnStateStop()  Line 584
xul.dll!nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream * stream=0x06acd290)  Line 406

and this section of code errors out:

nsresult
nsDiskCacheDevice::GetFileForEntry(nsCacheEntry *    entry,
                                   nsIFile **        result)
{
...
    // check/set binding->mRecord for separate file, sync w/mCacheMap
    if (binding->mRecord.DataLocationInitialized()) {
        if (binding->mRecord.DataFile() != 0)
            return NS_ERROR_NOT_AVAILABLE;  // data not stored as separate file

So this is a bit unfortunate. I don't know where "data not stored as separate file" is decided, and if I could do anything to work around this, but as-is this just tells my plugin "the stream is closed, there was no data" - and it has no way to work around it.
This is a duplicate of bug #723100. But I think that the patch from #723100 will never land. Instead, we will probably solve this in bug #725993 by removing cacheAsFile functionality.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 723100
You need to log in before you can comment on or make changes to this bug.