PDA

View Full Version : QHttp internal error



LubosD
15th August 2006, 15:43
Hello,

I need to post several HTTP requests to some broken server. The server is unable to process more than 1 request in 1 connection, it simply won't respond.
Terminating the connection seems to be the best solution:


QHttpRequestHeader header;

header.setRequest("POST", url.path(), 1, 0); // way #1 - force HTTP/1.0
header.addValue("Connection", "close"); // way #2 - force connection close
// some other code
m_http.request(...);

The server really does terminate connection when using HTTP/1.0 or Connection: close, but QT doesn't like it. After sending first request (and receiving response) I can't send any more using the same QHttp object.

My request never gets processed and I get this error in the console output:


QSocketNotifier: Invalid socket specified
QSocketNotifier: Internal error

Fortunately, I am able to workaround this problem just by setting new socket before every request:

m_http.setSocket(new QTcpSocket);
...but I still think that this isn't right - QT shouldn't generate Internal errors. Am I right and this should be fixed?

e8johan
16th August 2006, 10:57
Try reporting it at Trolltech's task tracker http://www.trolltech.com/developer/task-tracker and you will get their opinion of it. Personally, I think that internal errors should be avoided.