Closed Bug 484027 Opened 15 years ago Closed 15 years ago

Add "escape hatch" functionality to httpd.js

Categories

(Testing :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.1

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

Once bug 396226 lands, it shouldn't be difficult to add a way for a request handler be given semi-raw (mediated) access to the output stream for the connection, to allow writing arbitrary data through that connection.  This would allow for fun like a request handler that abruptly closes the connection without writing any data, writing malformed HTTP responses, and the like.  This isn't the full extent of what might be wanted -- in particular, for a request handler to be invoked the incoming request's head (and body, if any) must have been fully received -- but it's most of it, and it's not especially far afield of what a pluggable HTTP server might reasonably expose.
Blocks: 475444
Attached patch PatchSplinter Review
Getting all the corner cases correct was trickier than I expected but still relatively easy with bug 396226 fixed.
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Attachment #374314 - Flags: review?(sayrer)
Attachment #374314 - Flags: review?(sayrer) → review+
Comment on attachment 374314 [details] [diff] [review]
Patch

looks ok. I would think about making some named functions that test for these booleans rather repeating them.
The conditions aren't quite repeated enough, or in the same semantic manner, for me to be willing to add functions for them -- not to mention that I too had problems coming up with good names for them when I tried to do so.

http://hg.mozilla.org/mozilla-central/rev/fe9cc55b8db7

Will port to 191 (should be trivial, the two are fully synced since bug 396226 was ported) once it's clear this went fine (no problems actually expected), in the interests of keeping the APIs the same for backports and security fix patches...
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/615cb0a7c787
Keywords: fixed1.9.1
Target Milestone: mozilla1.9.2 → mozilla1.9.1
http://hg.mozilla.org/mozilla-central/rev/8a555b5e4f47
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/537a0ea689ab

Bad me, I forgot to bump the interface ID in the patch; did so now.  I also documented this functionality on this MDC page:

https://developer.mozilla.org/En/Httpd.js/HTTP_server_for_unit_tests
Component: httpd.js → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: