PDA

View Full Version : QHttp get returns the wrong page



SpeedxDevil
14th November 2010, 11:07
I'm using a bit of code my brother made so I'm not the expert though I understand the basics of it, I think.


serverConnection = new QHttp("www.web.be");
connect(serverConnection, SIGNAL(requestFinished(int,bool)), this, SLOT(serverStatus(int,bool)));
serverConnection->get("/status.php");
serverConnection->readAll();

Using qDebug it shows that instead of getting a simple "1" or "2" it gets a whole different page then status.php


"<head>
<meta http-equiv="refresh" content="0;url=http://ifastnet.com/notify2.html" />
</head>
<html>
<body>
<script LANGUAGE="JavaScript">
window.location="http://ifastnet.com/notify2.html";
</script>
<!-- 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 526 640 917 51 415 140 573 716 965 688 395 829 76 810 801 733 244 95 205 283 488 189 705 173 743 574 947 608 694 973 886 298 223 449 99 309 936 432 209 623 454 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 526 640 917 51 415 140 573 716 965 688 395 829 76 810 801 733 244 95 205 283 488 189 705 173 743 574 947 608 694 973 886 298 223 449 99 309 936 432 209 623 454 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 526 640 917 51 415 140 573 716 965 688 395 829 76 810 801 733 244 95 205 283 488 189 705 173 743 574 947 608 694 973 886 298 223 449 99 309 936 432 209 623 454 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 526 640 917 51 415 140 573 716 965 688 395 829 76 810 801 733 244 95 205 283 488 189 705 173 743 574 947 608 694 973 886 298 223 449 99 309 936 432 209 623 454 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 399 310 772 188 121 747 908 375 658 989 471 891 842 282 539 788 863 526 640 917 51 415 140 573 716 965 688 395 829 76 810 801 733 244 95 205 283 488 189 705 173 743 574 947 608 694 973 886 298 223 449 99 309 936 432 209 623 454 -->
</body>
</html>

<BR clear="all">
<HR noshade size="1px">
<ADDRESS>
Generated Sun, 14 Nov 2010 10:59:05 GMT by demil1.byetcluster.com (Lusca/LUSCA_HEAD-r14756)
</ADDRESS>
</BODY></HTML>
"

I'm sure the file is there and named correctly as I can browse to it and download it. Any idea why this might be happening? Host related?

greets,
Speedy

ChrisW67
14th November 2010, 22:46
Line 3: QHttp::get() is not synchronous, so that at line 4 of the QHttp::readAll() may not have anything to read. It' s a moot point though because at line 4 you discard the QByteArray return by readAll() so we have no idea where your debug output is coming from.

Is this the actual code or are you paraphrasing?