Hi
I am trying to communicate to an AXIS product and it sends me serial data over HTTP. The sequence is:
HTTP GET ->
<- HTTP 204 - No Content
<- HTTP Continuation or non-Http traffic
<- HTTP Continuation or non-Http traffic
<- HTTP Continuation or non-Http traffic
etc
HTTP GET ->
<- HTTP 204 - No Content
<- HTTP Continuation or non-Http traffic
<- HTTP Continuation or non-Http traffic
<- HTTP Continuation or non-Http traffic
etc
To copy to clipboard, switch view to plain text mode
I have traced through the QT code to the function QHttpPrivate::_q_slotReadyRead(). It appears that QT thinks it must find a valid header in the " HTTP Continuation or non-Http traffic" packets. Since the code can't find the header, it returns and does not extract the data.
void QHttpPrivate::_q_slotReadyRead()
{
QHttp::State oldState
= state;
if (state
!= QHttp::Reading) { setState
(QHttp::Reading);
readHeader = true;
bytesDone = 0;
chunkedSize = -1;
repost = false;
}
while (readHeader) {
bool end = false;
while (!end && socket->canReadLine()) {
tmp
= QString::fromAscii(socket
->readLine
());
end = true;
else
headerStr += tmp;
}
if (!end)
return; //****This is where it returns, ARG*********
void QHttpPrivate::_q_slotReadyRead()
{
Q_Q(QHttp);
QHttp::State oldState = state;
if (state != QHttp::Reading) {
setState(QHttp::Reading);
readHeader = true;
headerStr = QLatin1String("");
bytesDone = 0;
chunkedSize = -1;
repost = false;
}
while (readHeader) {
bool end = false;
QString tmp;
while (!end && socket->canReadLine()) {
tmp = QString::fromAscii(socket->readLine());
if (tmp == QLatin1String("\r\n") || tmp == QLatin1String("\n") || tmp.isEmpty())
end = true;
else
headerStr += tmp;
}
if (!end)
return; //****This is where it returns, ARG*********
To copy to clipboard, switch view to plain text mode
These packet types are apparently common (see http://ayis.javaeye.com/blog/351217), so why would QT drop them? Is there a bug in QT?
Any help would be greatly appreciated!
Bookmarks