librelist archives

« back to archive

M2 big uploads cancel response

M2 big uploads cancel response

From:
Jonas Pfenniger
Date:
2012-01-31 @ 16:58
Hi guys, 

I'm wondering, is it possible to add a message to denied upload requests ?
Just closing the connection is not really informative for the client, I 
would prefer to be able to tell him why he failed.

Otherwise, I made some tests with M2 and it's really impressive. I'll try 
to post some benchmarks when I'm done :) 

Cheers,
Jonas

Re: [mongrel2] M2 big uploads cancel response

From:
Dalton Barreto
Date:
2012-01-31 @ 17:14
2012/1/31 Jonas Pfenniger <jonas@pfenniger.name>:
> Hi guys,
>
> I'm wondering, is it possible to add a message to denied upload requests
? Just closing the connection is not really informative for the client, I 
would prefer to be able to tell him why he failed.
>

I don't think that this is currently possible. Becasue when you
backend handler denies a upload you send back to m2 a zero lenght
message. This is the signal that tells mongrel2: "I don't want this
upload anymore, close the connection please".

The communication between the handler and m2 is still very simple.
Maybe here is a opportunity to improve this communication, perhaps
create types of messages, etc.

> Otherwise, I made some tests with M2 and it's really impressive. I'll 
try to post some benchmarks when I'm done :)
>

Don't forget to post also the details no how you prepared and ran the
bechmark (not only the final results).
I'm interested in this as I also want to benchmark mongrel2 with my
generic WSGI handler [1].

[1] http://wsgid.com

Thanks,

-- 
Dalton Barreto
http://daltonmatos.com

Re: [mongrel2] M2 big uploads cancel response

From:
Zed A. Shaw
Date:
2012-02-08 @ 03:11
On Tue, Jan 31, 2012 at 03:14:54PM -0200, Dalton Barreto wrote:
> 2012/1/31 Jonas Pfenniger <jonas@pfenniger.name>:
> > Hi guys,
> >
> > I'm wondering, is it possible to add a message to denied upload 
requests ? Just closing the connection is not really informative for the 
client, I would prefer to be able to tell him why he failed.
> >
> 
> I don't think that this is currently possible. Becasue when you
> backend handler denies a upload you send back to m2 a zero lenght
> message. This is the signal that tells mongrel2: "I don't want this
> upload anymore, close the connection please".

Uh, no actually I believe you can send the proper 5xx response and then
close, which should abort it.  But I haven't tried it yet and it'd
depend on how the browser handles that.

-- 
Zed A. Shaw
http://zedshaw.com/