Closed Bug 484027 Opened 11 years ago Closed 10 years ago

Add "escape hatch" functionality to httpd.js


(Testing :: General, enhancement)

Not set


(Not tracked)



(Reporter: Waldo, Assigned: Waldo)



(Keywords: fixed1.9.1)


(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
Attachment #374314 - Flags: review?(sayrer)
Attachment #374314 - Flags: review?(sayrer) → review+
Comment on attachment 374314 [details] [diff] [review]

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.

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...
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2
Keywords: fixed1.9.1
Target Milestone: mozilla1.9.2 → mozilla1.9.1

Bad me, I forgot to bump the interface ID in the patch; did so now.  I also documented this functionality on this MDC page:
Component: httpd.js → General
You need to log in before you can comment on or make changes to this bug.