Game Development Community

T3D1.1 Beta 2/3 - HTTPObject queries doesn't work properly + fixes - RESOLVED

by Vincent BILLET · in Torque 3D Professional · 08/08/2010 (8:37 pm) · 15 replies

Step to reproduce :
1) Write a simple script in php like this :
<?php
echo($_SERVER["URL"]);
echo("-");
echo($_REQUEST["cmd"]);
echo("-");
echo($_REQUEST["arg1"]);
?>
1) launch T3D
2) Open Console and launch this script :
$WebService = new HTTPObject();
$WebService.get("someurl.com:80","/myphp.php","cmd=hello&arg1=secondArg");

function HTTPObject::onLine(%this,%line)  
{  
    %this.WebResp = %this.WebResp @ %line;  
}  
function HTTPObject::onDisconnect(%this)  
{
	echo(%this.WebResp);
	%this.WebResp="";
}
3) this should write into the console a line ending by :
/myphp.php?cmd=hello&arg1=secondArg-hello-secondArg
ATM it writes :
/myphp.php--

Suggested Fixe
in httpObject.cpp , line 174 : Comment this line :
//      asciiEscapeTable[static_cast<U32>('&')] = true;
(&'s Ascii Escape should be done in scripts)

in httpObject.cpp , line 366 : Comment these lines to make the code looks like this :
//   if(dStrcmp(query,""))
//		object->get(Address, requirstURI, NULL);
//   else
		object->get(Address, requirstURI, query);

#1
08/11/2010 (3:05 pm)
Logged as TQA-777 for the QA team to verify.
#2
08/19/2010 (10:53 pm)
Bug confirmed.
#3
01/23/2011 (8:56 am)
This is still an issue in 1.1 B3 - used the fix above and works. Worth logging and moving to B3 forums if still a bug.
#4
01/24/2011 (6:14 am)
Moved to B3 Forum
#5
02/19/2011 (10:54 am)
Where can I find the HttpObject.cpp file?
#6
02/19/2011 (12:27 pm)
(your Torque 1.1beta3 install location)\Engine\source\app\net

Enjoy :-)
#7
02/19/2011 (4:58 pm)
Thank you sir!
#8
02/19/2011 (5:33 pm)
Just as JulianR said, this still doesn't work.
#9
02/19/2011 (9:01 pm)
Greetings!

I've put in a fix for 1.1 Final.

- Dave
#10
02/20/2011 (8:06 am)
@David: If you're addressing this, you might consider this fix too:
www.garagegames.com/community/blogs/view/20661

(just make sure you watch, I think the code posted has some missing backslashes from what I remember)
#11
02/20/2011 (11:39 pm)
Cool ! Happy to see it fix!

Jameson fix also seems interesting.
#12
03/15/2011 (1:51 pm)
Greetings!

Logged the HTTPObject Post fix (from the resource) as THREED-1457. Thanks!

- Dave
#13
03/26/2011 (1:04 pm)
Still doesn't work in B2/B3, but the fix above does :)
#14
04/11/2011 (10:13 am)
Solved in T3D 1.1 Preview ! GREAT GREAT NEWS AND THANKS TO GG TEAM !
#15
04/14/2011 (5:25 pm)
Fixed in 1.1 Final and Preview.