-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async payload parsing stores all in memory #263
Comments
That is trade off for simpler implementation. I'd like to streaming parser, but it requires a lot of work. So right now it could be implemented in external library and then can be included to aiohttp.web later when api get finalized |
I have a proof-of-concept async parser, but there is no place in Request.post() method to replace implementation. |
IMHO It should be new method, not |
|
The question is not the method name but API: what object the method should return? |
There are no obvious reasons to add new method (only different behavior of cgi multipart parser and "the new one" - if it is buggy). By the way, |
|
|
@tumb1er would you make a Pull Request? |
I'm not sure about production-ready async form parser.
Options for pull-request:
So, any suggestions from aiohttp author? |
@tumb1er I think I'll be ready to make a PR with own multipart module on this weekends. Will take a look on test cases of projects you mentioned in case if I miss something. |
@kxepal it is not only multipart, all those projects also parse x-www-form-urlencoded data and octet-stream |
These mimetypes are about different data and ways to handle it. That's a separate issue. |
@kxepal but current aiohttp version as single parser for all these and it is vulnerable to DOS attack for urlencoded content-type also. |
@tumb1er one single parser for all is not a good thing. If I ask about x-www-form-urlencoded data I don't want it accidentally mutate into multipart thing. Let's keep things divided. And this discussion for another issue (: |
I need a streaming upload parser, too, and will create pull-request for same. How about this API? added method for aiohttp.Request
Usage example:
|
is it for client or for server? |
@rdbhost is it about multipart? Since it's already support streaming (and only) parse and upload. |
It is for the server, and would handle 'multipart/form-data' at least, and possibly 'url-encoded' and others. |
@rdbhost you should look to client multipart support, i'd prefer to extend it |
Yeah, I agree. Until this morning, I was unaware of the multipart module, but looking it over today, it looks pretty extensive and would be at least a good start to server side streaming body parsing. |
in
aiohttp.web.Request
:so to handle 10GB multipart upload aiohttp will reserve 10GB RAM.
IMHO, payload parser should be also asynchronous.
The text was updated successfully, but these errors were encountered: