nsHttpConnection::PushBack uses NS_NOTREACHED for code that is reached

RESOLVED FIXED

Status

()

Core
Networking: HTTP
RESOLVED FIXED
7 years ago
6 years ago

People

(Reporter: mcmanus, Assigned: mcmanus)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

currently in nsHttpConnection.cpp:

    nsresult PushBack(const char *data, PRUint32 length) { NS_NOTREACHED("PushBack"); return NS_ERROR_UNEXPECTED; }

Pushback is going to be called when an nsHTTPTransaction reads more data off the inputstream than was specified by the framing of the http response. The normal place this happens is in pipelining, where the "extra" bytes are really the first bytes of the next response in the pipeline. There is nothing wrong with that case - the pipeline::PushBack implementation moves them over to the right transaction.

But this can happen on a non-pipeline transaction when the server responds with more data than its framing indicates it will. We've seen that with 304/204 responses (which should be empty) as well as with HEAD in the past. I've also seen some servers add extra empty lines at the end of chunked encodings. It's all a server side bug, but its something we deal with fine with the existing behavior of nsHttpConnection::PushBack (i.e. do nothing) modulo the NOTREACHED complaints.

Just need to change the NS_NOTREACHED and NS_ERROR_UNEXPECTED to be a LOG and NS_OK, respectively.
Created attachment 507557 [details] [diff] [review]
pushback-notreached patch v1
Assignee: nobody → mcmanus
Status: NEW → ASSIGNED
Attachment #507557 - Flags: review?(honzab.moz)
Duplicate of this bug: 254181
Attachment #507557 - Flags: review?(honzab.moz)
http upgrade happened to fix this
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → WONTFIX

Updated

6 years ago
Resolution: WONTFIX → FIXED
You need to log in before you can comment on or make changes to this bug.