[Web-SIG] Collating follow-up on the future of WSGI

André Malo nd at perlig.de
Wed Jan 20 07:24:14 EST 2016


* Graham Dumpleton wrote:

> > On 20 Jan 2016, at 10:25 PM, André Malo <nd at perlig.de> wrote:

> > Regarding chunked requests - in my own WSGI implementation I went the
> > most pragmatic way and simply provided a CONTENT_LENGTH of -1 for unknown
> > request sizes (it maps very well to file.read(size)). Something like this
> > would be my suggestion for a future WSGI spec.
>
> I am assuming here you mean that -1 means return whatever you have
> available, or block until you have something.
>
> Problem with that is that some implementations will use -1 as a default
> value to mean no argument supplied and so read all input.

That was actually the idea. It has the same semantics (as in 
file.read(int(environ['CONTENT_LENGTH'])). Since -1 is not covered by RFC 
3875, it should not break much as well (*cough*).

>
> So that could well conflict with some implementations.
>
> Also, if it is going to block, how is it really different to reading with a
> block size.

It's not. It's a signal, that the gateway has no idea about the size of the 
request body and you (as the application) should not make any assumptions. 
You wouldn't read(-1) a file of unknown size either.

Cheers,
nd
-- 
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook? Ook. Ook! Ook! Ook? Ook! Ook. Ook? Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook! Ook! Ook!           Ook! Ook.


More information about the Web-SIG mailing list