Hi,

On Sunday, May 26, 2013 3:49:48 PM UTC+2, Sébastien Béal wrote:
>
> - limit resources available with the resource module. Is there any other 
> parts of Django using this technique?


Using rlimits are imo not an option; as (to my knowledge) it affects the 
whole process and not just the thread; also you'd have to reset it later on 
etc… All in all a solution which sounds to complicated imo.
 

> - use the zlib module instead of the gzip one with a max_size in the 
> decompress function. A pattern could be to require the Content-Length of 
> the request to be equal to the uncompress size and use it as the max_size 
> argument to be more dynamic, or just to set an arbitrary max_size. It will 
> involve more work than just using the gzip module though.
>

I am not sure that's going to fly well, since when you use gzip you 
probably wanna send plenty of data, and as long as the user can control the 
max_size you are running into the same issues; so the only option would be 
your suggested max_size. 

As Aymeric already pointed out, this is certainly easier in a real WSGI 
middleware, so the question is on whether we really want a suboptimal and 
error prone implementation as a django middleware. Personally I don't think 
it's worth is if the code is really as short as Aymeric demonstrated, ymmv.

Regards,
Florian

>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to