[Qt-interest] QHttp upload won't stream?
Info
info at misafe.com
Wed Oct 7 15:54:42 CEST 2009
I've taken your advise and started writing a test using QSslSocket and
handling it myself. I am running into the same problem though so
perhaps I am doing something wrong...
I startup a connection using QSslSocket::connectToHostEncrpyted()
When the encrypted() signal is fired, I send my HTTP request headers
I read in the data in the readyRead() slot until I have the header and
all following data for the response.
I then construct a new header to send the POST data to the server and
send that.
When the bytesWritten() signal is fired, I send the next block of data
using QSslSocket::write()
The problem I'm having is that I get exactly the same behaviour as
before, the data all gets sent immediately (obviously being buffered
by QSslSocket) and my progress jumps right to the end as before. Is
there something I should be doing differently here?
I have tried adding a flush() after the write() but that stops
transmission all together.
Thanks.
On 7 Oct 2009, at 00:35, Jason H wrote:
> You have to scan for the \r\n\r\n and feed everything up to the
> first \r\n that to QHttpRequestHeader, then you have to parse the
> data this means, if you have base64 content encoding or chuncked
> encoding you have to account for that. Be aware that the layering
> works out to be that SSL is first (and should be relatively
> transparent to you, then chunking, then base64, if applied. I used a
> QIODevice to do the base64 decoding, and manually parsed the content.
>
> I was writing a server though.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091007/defb6abe/attachment.html
More information about the Qt-interest-old
mailing list