Closed Bug 629458 Opened 13 years ago Closed 13 years ago

nsHttpConnection::PushBack uses NS_NOTREACHED for code that is reached

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mcmanus, Assigned: mcmanus)

References

()

Details

Attachments

(1 file)

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.
Assignee: nobody → mcmanus
Status: NEW → ASSIGNED
Attachment #507557 - Flags: review?(honzab.moz)
Attachment #507557 - Flags: review?(honzab.moz)
http upgrade happened to fix this
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Resolution: WONTFIX → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: