Closed Bug 268483 Opened 17 years ago Closed 17 years ago

Lock icon appears even though http connection failed.


(Core :: Networking: HTTP, defect)

Not set





(Reporter: dougt, Assigned: darin.moz)


(Blocks 1 open bug, )


(Keywords: fixed-aviary1.0.1, fixed1.7.6, Whiteboard: [sg:fix])


(3 files)

steps to reproduce:

1.  Go to
2.  Go to a https server that doesn't speak https.  For example, a https imap

expected result:

an error dialog and the content of the page shouldn't change.  most importantly,
the security of the page should remain the same -- lock icon unlocked.

actual result:

i see an error dialog, but then the lock icon is locked and the details in the
page security dialog suggest that has been verified.

marking security sensitive per conversation with darin
Target Milestone: --- → mozilla1.8beta
*** Bug 270676 has been marked as a duplicate of this bug. ***
I found a public secure IMAP server that can be used to demonstrate this bug:

Load that link, and then press the STOP button.  You should see the address bar
change to the locked state for the calmail server even though the page content
hasn't changed.  The choice of the STOP button is not special... any error
condition would likely yield the same result.
I believe this bug is a result of the patch for bug 148981.  I think it may be
wrong to synthesize a STATE_TRANSFERRING event when the status of the request is
a failure code and when it has not already transferred some data (the only case
where we would be synthesizing STATE_TRANSFERRING).

That patch was added in 2002 by rpotts, and I later added a further condition
that we skip that block of code when the status code is
NS_ERROR_BINDING_RETARGETED to fix security bug 257308.  Now, I think we should
just remove that block of code.

Patch coming up...
BTW, the reason why "httpChannel->GetResponseStatus(...)" was succeeding was
because we treated the text from the IMAP server as a HTTP/0.9 response (i.e., a
HTTP response with no status line or response headers).
Attachment #169740 - Flags: review?(cbiesinger)
Attachment #169740 - Flags: review?(cbiesinger) → review+
biesi raised an interesting point over irc:

It seems that this patch works because the HTTP channel's direct listener is not
the URI loader but rather an unknown content decoder.  It suppresses the ODA
because it is trying to figure out what sort of content the stream contains.

Perhaps it would make more sense to check if the request has been targeted or
not in place of the block of code I removed.  Only a targeted request (one with
the nsIChannel::LOAD_TARGETED load flag set) should trigger STATE_TRANSFERRING
(I think).  I might give that a try instead...
Attached patch v2 patchSplinter Review
alternate patch.
Comment on attachment 169752 [details] [diff] [review]
v2 patch

yeah... I think this is a better approach. I still wonder why the data just
disappears, though...

anyway, r=biesi.
Attachment #169752 - Flags: review+
it doesn't dissappear... instead it is stuck inside the unknown decoder's
internal buffer.  the decoder is waiting for the next ODA, but instead it gets
an OnStopRequest w/ status=NS_BINDING_ABORTED.  thus, the data is never pushed
to the final stream listener.
Attachment #169752 - Flags: superreview?(bzbarsky)
Comment on attachment 169752 [details] [diff] [review]
v2 patch

Attachment #169752 - Flags: superreview?(bzbarsky) → superreview+

dougt, is there any way you can verify the fix?
Closed: 17 years ago
Resolution: --- → FIXED
Blocks: 248511
Blocks: lockicon
Whiteboard: [sg:fix]
Shouldn't this be ported back to the branches?
Flags: blocking1.7.6?
Flags: blocking-aviary1.1?
Flags: blocking-aviary1.0.1?
Flags: blocking1.7.6?
Flags: blocking1.7.6+
Flags: blocking-aviary1.0.1?
Flags: blocking-aviary1.0.1+
Comment on attachment 169752 [details] [diff] [review]
v2 patch

Attachment #169752 - Flags: approval1.7.6+
Attachment #169752 - Flags: approval-aviary1.0.1+
*** Bug 280461 has been marked as a duplicate of this bug. ***
Verified Fixed.  Test case with no longer
displays yellow background and lock icon when the page load is stopped.

M18b1/Trunk: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050217

Aviary 1.0.1 Branch: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
Gecko/20050218 Firefox/1.0

M176 Branch: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6)

Based on my testing, it looks like this has been fixed everywhere.
Group: security
Flags: blocking-aviary1.1?
Attachment #187613 - Flags: superreview?(bzbarsky)
Attachment #187613 - Flags: review?(cbiesinger)
OS: Windows XP → All
Attachment #187613 - Flags: review?(cbiesinger) → review+
Attachment #187613 - Flags: superreview?(bzbarsky) → superreview+
You need to log in before you can comment on or make changes to this bug.