migel
10th August 2011, 11:57
Hi
I am experiencing a problem of long request with code 399. It is something randomly but occurs in 90% of requests. The data is XML which I need to parse.
If no 399 code I get part of my xml respond. The xml is incomplete.
Thoughts ??
This is how I make a connections and check for errors, I use all signals to make sure is all good.
connect(_reply,SIGNAL(finished()),this, SLOT(postFinished()));
connect(_reply,SIGNAL(readyRead()),this, SLOT(readyReadData()));
connect(_reply,SIGNAL(error(QNetworkReply::Network Error)),this, SLOT(postError(QNetworkReply::NetworkError)));
connect(_reply,SIGNAL(sslErrors ( const QList<QSslError> & )),this, SLOT(postSslErrors( const QList<QSslError> &)));
The data a get from readyReadData() so I should have it all there if no error and requests is finished , right ?
void FormPost::readyReadData() {
INFO_DEBUGME("http data are ready");
data = _reply->readAll();
INFO_DEBUGME(data);
if(_loop.isRunning())
_loop.exit();
}
The xml is fine too, all browser can parse it correctly. Also if the xml data is less, then I get full xml and no error.
I have tried to read a data from QNetworkReply::finished () same thing, incomplete xml data even if QT says
After this signal is emitted, there will be no more updates to the reply's data or metadata.
Any ideas ??
I am experiencing a problem of long request with code 399. It is something randomly but occurs in 90% of requests. The data is XML which I need to parse.
If no 399 code I get part of my xml respond. The xml is incomplete.
Thoughts ??
This is how I make a connections and check for errors, I use all signals to make sure is all good.
connect(_reply,SIGNAL(finished()),this, SLOT(postFinished()));
connect(_reply,SIGNAL(readyRead()),this, SLOT(readyReadData()));
connect(_reply,SIGNAL(error(QNetworkReply::Network Error)),this, SLOT(postError(QNetworkReply::NetworkError)));
connect(_reply,SIGNAL(sslErrors ( const QList<QSslError> & )),this, SLOT(postSslErrors( const QList<QSslError> &)));
The data a get from readyReadData() so I should have it all there if no error and requests is finished , right ?
void FormPost::readyReadData() {
INFO_DEBUGME("http data are ready");
data = _reply->readAll();
INFO_DEBUGME(data);
if(_loop.isRunning())
_loop.exit();
}
The xml is fine too, all browser can parse it correctly. Also if the xml data is less, then I get full xml and no error.
I have tried to read a data from QNetworkReply::finished () same thing, incomplete xml data even if QT says
After this signal is emitted, there will be no more updates to the reply's data or metadata.
Any ideas ??