Closed
Bug 24765
Opened 25 years ago
Closed 24 years ago
use cache manager for downloaded jar files
Categories
(Core :: Networking: Cache, defect, P2)
Tracking
()
VERIFIED
FIXED
M18
People
(Reporter: warrensomebody, Assigned: security-bugs)
References
()
Details
(Whiteboard: [nsbeta3+][PDTP2])
Attachments
(8 files)
35.27 KB,
patch
|
Details | Diff | Splinter Review | |
1.97 KB,
text/plain
|
Details | |
1.52 KB,
text/plain
|
Details | |
5.16 KB,
text/plain
|
Details | |
36.17 KB,
patch
|
Details | Diff | Splinter Review | |
35.28 KB,
patch
|
Details | Diff | Splinter Review | |
33.60 KB,
patch
|
Details | Diff | Splinter Review | |
21.66 KB,
patch
|
Details | Diff | Splinter Review |
Currently downloaded jar files end up in a subdirectory under the current
process directory. We need to use the facilities in the cache manager to save
jar files to that proper space accounting and cleanup is done.
Comment 1•25 years ago
|
||
Warren, I suggest you mark this bug a duplicate of 21250.
Reporter | ||
Comment 2•25 years ago
|
||
I'd say this one depends on 21250. Once we have stream-as-file, we need to hook
up the jar protocol to use it. Let's keep both of these.
Depends on: 21250
Reporter | ||
Comment 4•25 years ago
|
||
I'm not sure why this was marked PDT+. I think it's perfectly fine if the cache
doesn't manage downloaded jar files right now. Yes, they'll pile up and won't
get flushed, but that seems ok for beta.
Removing PDT+ designation from whiteboard in hopes that they'll read this and
reaccess. Probably was just a mistake that I put beta1 in the keywords.
Whiteboard: [PDT+]
We should adjust 21250 based on the status of this bug. Bug 21250 is currently
not a beta1 candidate.
Reporter | ||
Comment 9•25 years ago
|
||
Moving to M17 which is now considered part of beta2.
Target Milestone: M16 → M17
Comment 10•25 years ago
|
||
Putting on [nsbeta2-] radar. Not critical to beta2. Spoke with warren, he is
cool with this.
Whiteboard: 1d → [nsbeta2-]1d
Reporter | ||
Comment 11•25 years ago
|
||
A must for nsbeta3. We're currently eating up the user's disk space and never
freeing it. We all know how this was a customer escalation in 3.x.
Reporter | ||
Comment 12•25 years ago
|
||
*** Bug 48536 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•25 years ago
|
Assignee | ||
Comment 14•25 years ago
|
||
I'm attaching a patch plus three new files which should be installed as
netwerk/base/public/nsIDownloader.idl, base/src/nsDownloader.h, and
base/src/nsDownloader.cpp. I've tested this for several remote JAR URLs and some
jar:file URLs as well, it seems to work in both cases. All of my testcases
called AsyncRead() on the JARChannel; I can't find a case which tests
OpenInputStream() so I'm not sure if this works. Do you know how to trigger this
case, Warren?
Subsequent reloads of the same page seem to be hitting the cache, not the
network. I can't really tell how good it is about updating when the remote file
changes, but it seems to do roughly as well as ordinary http pages. jar:ftp:
does not work since ftp does not support stream-as-file caching, but that's not
a high priority. I've also made signature verification lazy and added some code
to nsJARURI so that GetHost() and similar calls will work for JAR URLs.
Assignee | ||
Comment 15•25 years ago
|
||
Assignee | ||
Comment 16•25 years ago
|
||
Assignee | ||
Comment 17•25 years ago
|
||
Assignee | ||
Comment 18•25 years ago
|
||
Reporter | ||
Comment 19•24 years ago
|
||
I tried the patch and it doesn't work. Nothing comes up at all.
Sorry, but I don't have time to trace through it before I leave. I'll enclose
my updated diffs though.
Reporter | ||
Comment 20•24 years ago
|
||
Reporter | ||
Comment 21•24 years ago
|
||
BTW, Mitch, the changes you made to nsJARURI aren't right (I noticed them in my
revised patch). Jar URLs don't have any concept of a
host/port/username/password/prehost or path. Those methods need to fail.
I suspect you implemented them because you found that they were called and
caused something else to fail. Let's find the place that's trying to access
them and see what it's trying to do.
Assignee | ||
Comment 22•24 years ago
|
||
Assignee | ||
Comment 23•24 years ago
|
||
Upping priority since the jar protocol and signed scripts are of limited
usefulness without this.
Priority: P3 → P1
Assignee | ||
Comment 24•24 years ago
|
||
Comment 25•24 years ago
|
||
PDT thinks this is P2.
Priority: P1 → P2
Whiteboard: [nsbeta3+] → [nsbeta3+][PDTP2]
Comment 26•24 years ago
|
||
diff -u format please, I am not going to review diff -c with bogus indentation.
There appear to be tab and indentation problems and variations (the in boolean
synchronous parameter to init in nsIDownLoader.idl, the mixing of four-space
with two-space indentation in nsDownLoader.cpp, etc.). For example,
! if (mObserver && (NS_FAILED(rv) || localFile))
! {
There is an else-after-return non-sequitur, two-space rather than four-space
equivalent indentation, and more brace-style conflict with the prevailing style
used in the rest of the file on the subsequent lines:
! if (aSynchronous)
! return mObserver->OnDownloadComplete(this, mContext, rv, localFile);
! else
! {
! // If the open failed or the file is local, call the observer.
! // don't callback synchronously as it puts the caller
! // in a recursive situation and breaks the asynchronous
! // semantics of nsIDownloader
! nsresult rv2 = NS_OK;
! NS_WITH_SERVICE(nsIProxyObjectManager, pIProxyObjectManager,
! kProxyObjectManagerCID, &rv);
! if (NS_FAILED(rv2)) return rv2;
! nsCOMPtr<nsIDownloadObserver> pObserver;
We just indented four spaces for no reason -- hard tabs in file?
! rv2 = pIProxyObjectManager->GetProxyForObject(NS_CURRENT_EVENTQ,
! NS_GET_IID(nsIDownloadObserver), mObserver,
! PROXY_ASYNC | PROXY_ALWAYS, getter_AddRefs(pObserver));
! if (NS_FAILED(rv2)) return rv2;
! return pObserver->OnDownloadComplete(this, mContext, rv,
localFile);
! }
It's not good manners to go against the prevailing style used in netwerk code,
but if you own this file (it looks like you checked in the first revision) and
want to assert your own style, please make it self-consistent style throughout.
/be
Assignee | ||
Comment 27•24 years ago
|
||
Assignee | ||
Comment 28•24 years ago
|
||
By Jove, I think we've got it. Fix checked in, finally. We should no longer be
creating a bin/components/jarCache directory, and files loaded via the jar
protocol from an http source should stay up to date according to the standard
file cache policy.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•