Closed Bug 42505 Opened 24 years ago Closed 24 years ago

docshell puts wrong load attributes for http channel

Categories

(Core :: DOM: Navigation, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: tomi.leppikangas, Assigned: jud)

Details

(Keywords: embed, verifyme, Whiteboard: nsbeta2+)

If you put pref "Compare the page in the cache to the page on the network"
to "Newer", mozilla should not check pages on cache from net, but it does.

Bug seems to be on
http://lxr.mozilla.org/mozilla/source/docshell/base/nsDocShell.cpp#2658
Where is only 'case loadNormal:" but clicking on link is 'case loadLink:'
So when you click on link, loadAttribs |= nsIChannel::VALIDATE_NEVER is
not done and page is checked from net.

Fix for this is at bottom. There is also other enum cases that aren't
checked:

warning: enumeration value `loadNormalReplace' not handled in switch
warning: enumeration value `loadReloadBypassCache' not handled in switch
warning: enumeration value `loadReloadBypassProxy' not handled in switch
warning: enumeration value `loadLink' not handled in switch

Maybe those should be handled too.

Index: docshell/base/nsDocShell.cpp
===================================================================
RCS file: /cvsroot/mozilla/docshell/base/nsDocShell.cpp,v
retrieving revision 1.139
diff -u -r1.139 nsDocShell.cpp
--- docshell/base/nsDocShell.cpp        2000/06/13 23:56:29     1.139
+++ docshell/base/nsDocShell.cpp        2000/06/14 18:06:35
@@ -2667,6 +2667,7 @@
                        loadAttribs |= nsIChannel::FORCE_RELOAD;
                        break;
      case loadNormal:
+     case loadLink:
                   // Set cache checking flags
                   if ( mPrefs )
                   {
Changing assignment.

Thanks for the patch, it looks good. I'm applying it to my source, but the 
checkin will probably have to wait for M16 to go out because the tree is closed.
Status: NEW → ASSIGNED
Reassigning to myself
Assignee: locka → adamlock
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Checked in. Thanks Tomi!
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Valeski's checking for #39474 removed this fix, so reopening this bug.

http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=nsDocShell.cpp&root=/cvsroot&subdir=mozilla/docshell/base&command=DIFF_FRAMESET&rev1=1.156&rev2=1.157

And those other missing enums should be added too, just for
clearity and shut warnings off?

(gagan say to cc him and mscott)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
bizarre. I have no idea how that happened.
Assignee: adamlock → valeski
Status: REOPENED → NEW
Keywords: embed, nsbeta2
Whiteboard: nsbeta2+
fix in
Status: NEW → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Adding verifyme keyword.
Keywords: verifyme
code level
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.