I was looking through some publisher code and found that the
`process_request` method which takes the request body as a file-like
object and processes it as a FieldStorage happens within the application
thread.

This would be better if it happened beforehand because it can takes up
time while a transaction is running and a thread is used although it
doesn't require any application-specific code.

AFAICT a modified version of FieldStorage would be required to allow
line-wise consumption and parsing of data while it is being uploaded and
then hand this into the request instead of stdin.

However, the FieldStorage implementation is recursive and wasn't obvious
to me at a first glance how much work it would be to replace this.

Are there similar feelings it would be a good idea to do this kind of
early line-wise processing of request bodies?

Christian

Am Mittwoch, den 07.03.2007, 17:44 +0100 schrieb Christian Theune:
> Hi,
> 
> [modified slightly from a similar proposal to zope3-dev to match Zope
> 2's publisher]
> 
> I'm writing up a proposal for the ZODB to make even more efficient Blob
> handling possible.
> 
> This includes not copying the data from an uploaded file, but using a
> `link` operation when possible. 
> 
> However, the HTTPRequest class currently uses the default implementation
> of the cgi module's FieldStorage.
> 
> I propose to create a small subclass to override the `make_file` method
> to use `NamedTemporaryFile` instead of `TemporaryFile` to allow the file
> being accessible from a filename so I can apply a `link` operation.
> 
> Notice: The FieldStorage explicitly provides the `make_file` method to
> allow overriding in this sense.
> 
> Does anybody feel like this would be a bad idea?
> 
> Christian
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )
-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - [EMAIL PROTECTED] - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to