rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
* broken-pipe issue using apache/phusion
@ 2011-01-08 21:19 Randy Fischer
  0 siblings, 0 replies; only message in thread
From: Randy Fischer @ 2011-01-08 21:19 UTC (permalink / raw)
  To: phusion-passenger, rack-devel

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

I run phusion under a recent red hat apache, using the rack-based

I've had a problem when doing POSTs and PUTs and an error
occurs; I get a 500 server error regardless of the actual status
I'm trying to return: phusion bitterly complains:

  Unexpected error in mod_passenger: An error occured while sending the
request body to the request handler: Broken pipe (32)
     in 'virtual void Passenger::Application::Session::sendBodyBlock(const
char*, unsigned int)' (Application.h:159)
     in 'void Hooks::sendRequestBody(request_rec*,
boost::shared_ptr<Passenger::BufferedUpload>&)' (Hooks.cpp:1163)
     in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:567)

Now in sinatra, I can take care of this via an error handler, which
does a quick:

    request.body.rewind if request.body.respond_to? :rewind

After this point, my sinatra errors care correctly returned,
instead of the 500 error provided by phusion.

Lately I've come across the same problem using a rack handler
for basic authentication.  If there is a GET or DELETE request
attempted with the wrong password, no problem.  But if
authentication fails on a PUT or POST, I'm back to the broken
pipe error being returned - a 500 instead of the correct 4xx
authentication error.

So: is there a clean way to handle these problems I'm unaware
of?  If not, is there a rack handler that does something similar
to the technique I'm using in sinatra? (I'm a complete rack

Thanks for your time.

-Randy Fischer

[-- Attachment #2: Type: text/html, Size: 2056 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-08 21:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-08 21:19 broken-pipe issue using apache/phusion Randy Fischer

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).