PDA

View Full Version : QNetworkAccessManager get signal on every separate chunk of data



Winterhearted
28th September 2012, 11:41
Hi guys!

I'm newby in Qt world and this is my first thread on the forum, so don't beat my hard if I'm making something wrong :)

My question is: How I can get signal on every separate chunk when I'm receiving data from HTTP server using chunked encoding?

E.g.

For such pesponse:

HTTP/1.1 200 OK
Server: nginx/1.0.4
Date: Thu, 06 Oct 2011 16:14:01 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.6

25
This is the data in the first chunk

10
and this is the second one
0

I want to get two separate signals with pointers to "This is the data in the first chunk" for first signal and "and this is the second one" for second one.

Thanks in advance!

wysota
29th September 2012, 19:49
Parse the data as it comes in and find chunk boundaries yourself. QNetworkAccessManager won't do it for you.