[prev in list] [next in list] [prev in thread] [next in thread] 

List:       uwsgi
Subject:    Re: [uWSGI] Data in post-buffering mode
From:       Daniel Nicoletti <dantti12 () gmail ! com>
Date:       2016-02-01 13:14:04
Message-ID: CACo8zOcaNr45yCq1mGzyjYvwhGr4pAJH1-12O+TZarkGHd819g () mail ! gmail ! com
[Download RAW message or body]

Ok,
I've looked at the code and concluded one cannot have
uwsgi_request_body_read and
uwsgi_request_body_readline mixed
as readline has it's own pos and seek does
not reset it, so I was doing this after seek:
m_request->post_readline_pos = m_request->post_pos;
and this caused the crash...
I'll just remove the calls to readline so QIODevice emulates
that for me...

best


2016-02-01 11:03 GMT-02:00 Daniel Nicoletti <dantti12@gmail.com>:
> Hi,
>
> I'm getting a crash on post buffering mode, this used to work, so I'm
> not sure it's
> related to some version o uwsgi, or if I am doing something wrong.
>
> basically my code calls uwsgi_request_body_read()
> to do the multipart parsing, after I know the body part offsets I call
> uwsgi_request_body_seek(0)
> after that the user will likely want to save one or all the parts to a file
> so another seek is set to point to the beggining of the
> part and
> uwsgi_request_body_read() is called.
> Now the function returns fine, as it has read data, but
> accessing the buffer for debugging or for calling
> memcpy crashes as it had already freed that buffer.
>
> I know this is the behavior of when not using post-buffering
> so I just fill a buffer to enable the same behavior.
>
> What could I be doing wrong?
>
> the code:
> https://github.com/cutelyst/cutelyst/blob/master/uwsgiEngine/bodyuwsgi.cpp#L58
>
> thanks
>
> --
> Daniel Nicoletti
>
> KDE Developer - http://dantti.wordpress.com



-- 
Daniel Nicoletti

KDE Developer - http://dantti.wordpress.com
_______________________________________________
uWSGI mailing list
uWSGI@lists.unbit.it
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic