Last Comment Bug 484027 - Add "escape hatch" functionality to httpd.js
: Add "escape hatch" functionality to httpd.js
: fixed1.9.1
Product: Testing
Classification: Components
Component: httpd.js (show other bugs)
: unspecified
: All All
-- enhancement (vote)
: mozilla1.9.1
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
Depends on: 396226
Blocks: 475444
  Show dependency treegraph
Reported: 2009-03-18 10:56 PDT by Jeff Walden [:Waldo] (remove +bmo to email)
Modified: 2009-05-30 21:34 PDT (History)
2 users (show)
jwalden+bmo: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

Patch (27.15 KB, patch)
2009-04-23 12:29 PDT, Jeff Walden [:Waldo] (remove +bmo to email)
sayrer: review+
Details | Diff | Splinter Review

Description User image Jeff Walden [:Waldo] (remove +bmo to email) 2009-03-18 10:56:27 PDT
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.
Comment 1 User image Jeff Walden [:Waldo] (remove +bmo to email) 2009-04-23 12:29:24 PDT
Created attachment 374314 [details] [diff] [review]

Getting all the corner cases correct was trickier than I expected but still relatively easy with bug 396226 fixed.
Comment 2 User image Robert Sayre 2009-05-28 22:25:00 PDT
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.
Comment 3 User image Jeff Walden [:Waldo] (remove +bmo to email) 2009-05-29 00:00:59 PDT
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...
Comment 4 User image Jeff Walden [:Waldo] (remove +bmo to email) 2009-05-30 18:26:02 PDT
Comment 5 User image Jeff Walden [:Waldo] (remove +bmo to email) 2009-05-30 21:34:46 PDT

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

Note You need to log in before you can comment on or make changes to this bug.