[FIXED][B3RC4] Maniascript : CreateGet url truncated ?

Moderator: NADEO

User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

[FIXED][B3RC4] Maniascript : CreateGet url truncated ?

Post by spaii »

Yesterday i made a big test on WorldRecords with a lot of players in Stunters Title Pack (before officialy activate this feature)
I discovered this strange issue
This is the portion of code i'm using for sending informations to stunters database each time a player reach finish line

Code: Select all

Text HackServerLogin()
{
	return "stunters";
}

Void PlayerFinish(CTmModeEvent _Event)
{
	declare Text Interface for UIManager.UIAll;
	declare _Player <=> _Event.Player;
	
	declare Text 	JSONFigures 		for _Player = "";
	
	if (Http.SlotsAvailable > 0)
	{			
		declare urlTxt = "http://xxxx.xxxx.xxx/?enviro=" ^ Environment();
		urlTxt ^= "&interface=" ^ Interface;
		urlTxt ^= "&mapuid=" ^ Map.Id;
		urlTxt ^= "&login=" ^ _Player.Login;
		urlTxt ^= "&score=" ^ _Player.CurRace.StuntsScore;
		urlTxt ^= "&distance=" ^ _Event.Distance;
		urlTxt ^= "&timeplayed=" ^ (Now - _Player.RaceStartTime);
		urlTxt ^= "&figures=[" ^ JSONFigures ^ "]";
		urlTxt ^= "&language="^_Player.User.Language;
		urlTxt ^= "&zonepath=" ^ TextTools::UrlEncode(_Player.User.ZonePath);
		urlTxt ^= "&nickname=" ^ TextTools::UrlEncode(_Player.User.Name);
		
		if(Interface == "multi")
		{
			urlTxt ^= "&serverlogin=" ^ HackServerLogin();
		}
		else if(Interface == "solo")
		{
			urlTxt ^= "&serverlogin=";
		}
		
		log("PlayerFinish URL : "^urlTxt);
		
		HttpReqs[_Player.Login] = Http.CreateGet(urlTxt);
	}
	else
	{
		log(Interface ^ " PlayerFinish() : NO HTTP SLOTS AVAILABLE !!!");
	}	
}

for log("PlayerFinish URL : "^urlTxt);, the urlTxt variable is complete and ok in maniaplanetserver log file.

in http server log, url is truncated. : end of url : &nickname=blablabla&serverlogin=stunt
there is missing "ers" of stunters, and, when url is bigger (with bigger figurelist), then nickname is truncated too.

At start i thought the problem come from http server, then i tested to put the complete url in http browser (chrome), and all is ok with same or bigger url.

I think HttpRequest::CreateGet(urlTxt); truncate url before posting to http server...

Thx ;)


Edit : tested with CreatePost(urlTxt, ""); and same issue...
by the way, with CreatePost, in php, I have to get the posted variables with $_GET and not $_POST ;)
Last edited by spaii on 16 May 2013, 17:12, edited 1 time in total.
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by spaii »

d2
User avatar
Gugli
Nadeo
Nadeo
Posts: 536
Joined: 14 Jun 2010, 17:35
Location: Mon PC est à Paris, mais mon coeur rode dans les forêts de Lozère

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by Gugli »

I have tried with 1k long URLs, and with a dozen different GET params, without reproducing the bug.
Could you copy/paste here one full faulty URL (the one you log).

Thanks for the report.
--
(>~_~)> ═╦═ ╔╦╗ <(~_~<)
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by spaii »

thx for response ;)

This is log from NGINX server and ManiaPlanetServer log file with some long url :
http://bugs.stunters.org/TruncatedURL.txt
If i take url from maniaplanetserver log and i put this one on chrome, all is ok.

I use NGINX, and i tested a lot of configurations options, with no success
I would like to test with apache server.

At start i used lighttpd, but there is a strange bug, when ManiaPlanetServer is on same machine than http server.
http server did not receive HTTP_USER_AGENT, even if i change /etc/hosts file, or in http server configuration options
This issue is the same with NGINX. i have to investigate this too...

Edit : urls are longer than 1k ;)
User avatar
Gugli
Nadeo
Nadeo
Posts: 536
Joined: 14 Jun 2010, 17:35
Location: Mon PC est à Paris, mais mon coeur rode dans les forêts de Lozère

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by Gugli »

That's weird.

I've run some tests with Apache, with the URLs you provided, pointing to a file or a folder. My ApacheLog is correct in both cases. I've no time right now to install NGINX to try, so I'll have to wait for other reports.

Code: Select all

127.0.0.1 - - [20/Feb/2013:11:02:20 +0100] "GET /test.xml?enviro=TMCanyon&interface=multi&mapuid=fBptp1xVMq61BbsceBPjosWeYig&login=spaii&score=1158&distance=1905.5&timeplayed=63496&figures=[[4,50,360,0,0,0,0,6527],[4,38,180,1,0,0,0,9328],[7,51,180,2,0,0,0,11661],[1,10,0,3,0,0,0,13196],[1,4,0,4,0,0,0,14345],[1,4,0,5,0,0,0,15511],[2,30,180,6,0,0,0,16378],[16,88,180,7,0,0,0,17878],[13,131,360,8,0,0,0,19345],[35,-50,0,0,0,0,0,19745],[4,60,360,9,0,0,0,25838],[1,5,0,10,1,0,0,26795],[7,44,180,11,0,0,0,28161],[25,44,360,12,0,0,0,30094],[10,72,180,13,0,0,0,31928],[18,15,0,14,0,0,0,33945],[15,187,360,15,0,0,0,35947],[35,-50,0,0,0,0,0,38464],[4,60,360,16,0,0,0,44911],[5,44,180,17,0,0,0,48115],[8,89,360,18,0,0,0,50278],[7,39,180,19,0,0,0,51295],[7,34,180,20,0,0,0,52060],[8,60,180,21,0,0,0,53861],[15,85,360,22,0,0,0,55495],[8,47,180,23,0,0,0,56694],[-1,1158,0,0,0,0,0,63496]]&language=fr&zonepath=World%7CEurope%7CFrance%7CNord%2DPas%20de%20Calais%7CPas%2Dde%2DCalais&nickname=%24i%24o%24009L%24z%24FFF%24o_%24C00%24wt%24z%20%24fff%24o%24w_%24z%24fff%24o___&serverlogin=stunters HTTP/1.1" 200 23
127.0.0.1 - - [20/Feb/2013:11:09:33 +0100] "GET /?enviro=TMCanyon&interface=multi&mapuid=fBptp1xVMq61BbsceBPjosWeYig&login=spaii&score=1158&distance=1905.5&timeplayed=63496&figures=[[4,50,360,0,0,0,0,6527],[4,38,180,1,0,0,0,9328],[7,51,180,2,0,0,0,11661],[1,10,0,3,0,0,0,13196],[1,4,0,4,0,0,0,14345],[1,4,0,5,0,0,0,15511],[2,30,180,6,0,0,0,16378],[16,88,180,7,0,0,0,17878],[13,131,360,8,0,0,0,19345],[35,-50,0,0,0,0,0,19745],[4,60,360,9,0,0,0,25838],[1,5,0,10,1,0,0,26795],[7,44,180,11,0,0,0,28161],[25,44,360,12,0,0,0,30094],[10,72,180,13,0,0,0,31928],[18,15,0,14,0,0,0,33945],[15,187,360,15,0,0,0,35947],[35,-50,0,0,0,0,0,38464],[4,60,360,16,0,0,0,44911],[5,44,180,17,0,0,0,48115],[8,89,360,18,0,0,0,50278],[7,39,180,19,0,0,0,51295],[7,34,180,20,0,0,0,52060],[8,60,180,21,0,0,0,53861],[15,85,360,22,0,0,0,55495],[8,47,180,23,0,0,0,56694],[-1,1158,0,0,0,0,0,63496]]&language=fr&zonepath=World%7CEurope%7CFrance%7CNord%2DPas%20de%20Calais%7CPas%2Dde%2DCalais&nickname=%24i%24o%24009L%24z%24FFF%24o_%24C00%24wt%24z%20%24fff%24o%24w_%24z%24fff%24o___&serverlogin=stunters HTTP/1.1" 200 9846
--
(>~_~)> ═╦═ ╔╦╗ <(~_~<)
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by spaii »

Erf, effectively for apache.

I will install apache and make some tests.

Thank you for your attention :thumbsup:
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by undef.de »

Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by spaii »

Thx undef !!

I already changed theses value in NGINX configuration, and problem persist.
changed with big values in php.ini :
max_input_time
max_input_nesting_level
max_input_vars
post_max_size

i verified if suhosin is really deactivated in my php version, and it is.

Theses days i changed NGINX server by apache server and... problem persist. :lol:

Tested to change url from xxx.stunters.org to 127.0.0.1

The problem is only when ManiaPlanetServer is on the same machine than http server.

I plan to reinstall the complete server, perhaps i changed something when i first install this server...

Thx for help ;)
User avatar
undef.de
Posts: 2095
Joined: 06 Apr 2011, 21:57
Location: Germany, North Sea Coast
Contact:

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by undef.de »

spaii wrote: The problem is only when ManiaPlanetServer is on the same machine than http server.
On which system? Windows or Linux?
Developer of UASECO, a controller with support of the Modescript Gamemodes for TM².
Visit the official website for more: UASECO.org


Developer of various plugins for XAseco/XAseco2 and MPAseco, visit my lab: www.undef.name

You like what I do? Then award a ManiaStar.
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [B3RC4] Maniascript : CreateGet url truncated ?

Post by spaii »

Linux Debian 6.0.7 64bits
Locked

Return to “Maniaplanet Reports”

Who is online

Users browsing this forum: No registered users and 1 guest