Malcolm Tredinnick wrote:
> I'm not 100% certain either. However, of the only hope you (Apache) have
> to avoid being hit by a truck is to hope that the guy behind you
> (Django) hold up a stop sign in time, then I would start looking for a
> plan B.

AFAIK mod_python's handler is called very early in the process before 
all the data is already on the server. I then read all the request data 
from a stream (which I suppose connects to the receving tcp socket may 
be over some buffering wrappers). But user's code is not hit until 
Django mod_python handler chews everything in memory or in the temp file 
(using appropriate patches). I often think this would be a good idea to 
be able to intercept this process with some user pluggable code.

The following is may be better suit for django-developers... I see this 
as two changes:

- a setting for buffer size when reading from a stream. This may as well 
override my STORE_UPLOAD_ON_DISK from 
http://code.djangoproject.com/ticket/1484. When stream is bigger than 
the buffer it is restored in a temp file and kept in memory otherwise

- a new middleware method "prcess_stream" that users can hook into to do 
something. Two obvious usecases are limiting the upload size and 
counting upload progress somewhere in the database that can be read live 
from another ajax request updating some shiny progress bar in a browser.

But I'm a bit reluctant to start implementing such things since my much 
simpler patch is not applied for some unknown reason :-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to