No message given when http connection immediately closes




Document Navigation
10 years ago
9 years ago


(Reporter: Matthew Cline, Unassigned)



Firefox Tracking Flags

(Not tracked)




10 years ago
Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/2008101204 GranParadiso/3.0.4pre ID:2008101204

A web server I'm trying to access is accepting http connections and then immediately closing them.  This results in Firefox displaying an empty page without giving any sort of message/pop-up.
Matthew, do you possibly have a URL I could reproduce this at?  Would be good to know what error code networking is returning here....

Comment 2

10 years ago
Sorry, the web server that was having the problem got it fixed.
Jeff, can we get our unit test server to behave like this?
Chris, you might know the answer to comment 3 too; you touched the http server recently, right?  ;)

Comment 5

10 years ago
Yep, you can write server side javascript, .sjs files. There are some examples in the tree. Or I could write one if you want :)
If you can do one off the top of your head, that would be great...

Comment 7

10 years ago
The HTTP server can't do what you want here because it's written to, well, actually work correctly.  :-D  (I also wouldn't accept a patch; this sort of thing really has to be a one-off thing, unfortunately.)  You'd need to write a stupid little custom server to test this, and for something that could be used from Mochitest you'd probably have to dive into an SJS and grunge around to create the actual server and get the gnarly callbacks working so it would properly shut down when it'd accepted the connection and everything.

Summarized, there's no turnkey solution right now for emulating misbehaving servers, but it's entirely possible to do so (but only if you're willing to put the effort into it, of course).  The problem will be finding someone with the time to do it.  :-(
Are we willing to put some effort into making it easy to emulate misbehaving servers?  That's a very common thing we need to test, actually (both in unit tests and in mochitest).

Comment 9

9 years ago
Depending on what exact timing is acceptable for when the connection's closed (before or after the request headers are sent?), it may now (after bug 484027) be possible to do what this bug wants now with this SJS:

function handleRequest(request, response)
You need to log in before you can comment on or make changes to this bug.