PDA

View Full Version : QTcpSocket : gettin all the response from HTTP



giusepped
21st October 2011, 12:23
I am trying to make a proxy in Qt, but again I have problems.
Suppose that I have a response from a server which zips the data. Suppose that (rare case) the header comes, and after some delay
comes the zipped body. Since I want to filter the body, I have to change the Content-Length parameter.
I implemented a solution (adding Content-Length before the body), but it seems to not work.
I think I have to buffer the whole response and make filtering,before sending to to browser....
Any help appreciated.
P.S. The processing of incoming data are handled by calling a slot() upon the firing of the signla readReady.
The problem here that the signal readReady is called twice: one for the header, and one for the body. From
that I stem that there is a delay in the webserver...



"HTTP/1.1 200 OK
Date: Fri, 21 Oct 2011 11:16:25 GMT
Server: Apache/1.3.27 (Unix) Debian GNU/Linux mod_gzip/1.3.26.1a mod_python/2.7.8 Python/2.2.2
X-Spyce: Spyce/modpy_1.3.13 Python/2.2
Content-Type: text/html; charset=iso-8859-1
Content-Length: 273

"
=== IN ANTOHER readReady() signal(), follow gzipped data=
"?