Hi,
I'm trying a sample QT program available on trolltech webdoc [http://doc.trolltech.com/4.6/qhttp.html#details] to interface to HTTP.
But it's giving "SegFault" for QHttp::setHost(). Kindly help me to figure out the root cause and fix to resolve it.
Following is the code snippet that I've tried.
---------------------------------------------
QHttp m_pHttp = new QHttp();
void CHttpClient::execute()
{
QHttpRequestHeader header("GET", QUrl::toPercentEncoding("/index.html"));
header.setValue("Host", "qt.nokia.com");
m_pHttp->setHost("qt.nokia.com");
m_pHttp->request(header);
}
Call stack
----------------------------
0 QBasicAtomicInt:perator!= qbasicatomic.h 75 0x680ac32a
1 QList<QHttpRequest*>::detach qlist.h 122 0x680a669f
2 QList<QHttpRequest*>::append qlist.h 468 0x680a661b
3 QHttpPrivate::addRequest qhttp.cpp 2385 0x6801206e
4 QHttp::setHost qhttp.cpp 2037 0x680113a0
5 CHttpClient::execute CCommunicator.cpp 93 0x004078f3
...
Excerpt:qbasicatomic.h
----------------------------
inline bool operator!=(int value) const
{
return _q_value != value;
}
here, this = 0x0 => resultuing into seg fault
----------------------------
regards,
pritam
Bookmarks