Page 1 of 1

[B2.0d] CHttpManager : SlotsAvailable

Posted: 31 Dec 2012, 02:35
by spaii
In maniascript : SlotsAvailable always decrement and never increment.
Even if request is destroyed after use it.

We can't continue to use HttpRequest when SlotsAvailable reach 0.
else there is error :
The procedure CreateGet failed to complete :
Unable to create the request

By the way Http.IsValidUrl always return true.

This is a portion of code i use :

Code: Select all

if (Http.SlotsAvailable > 0)
	{
		declare Text urlTxt = "http://api.stunters.org/ml/canyon/records/" ^ Interface ^ "/" ^ Map.Id ^ "/cache/" ^ Now;
		if (Http.IsValidUrl(urlTxt))
		{
			declare req2 <=> Http.CreateGet( urlTxt ) ;
			wait(req2.IsCompleted);
			if ("" ^ req2.StatusCode == "12007") log("Not Connected");
			if ("" ^ req2.StatusCode == "404") log("Error 404");
			if ("" ^ req2.StatusCode == "200")
			{
				log("Http StatusCode 200 " ^ Map.Id ^ " " ^ req2.Result);
				WorldRecordsLayer.ManialinkPage = GetManialinkPage(req2.Result);
			}
			
			Http.Destroy(req2);
			req2 = Null;
					
			// log("GetOnlineMl Http.Requests.count " ^ Http.Requests.count);
			// log("GetOnlineMl Http.SlotsAvailable " ^ Http.SlotsAvailable);					
		}
	}

Re: [B2.0d] CHttpManager : SlotsAvailable

Posted: 03 Jan 2013, 12:22
by Gugli
Ooooops.... Just dizzy me making bugs... -_-'

This will be fixed in next update, thanks for the report and sorry for the issue.

Edit : IsValidUrl only check if the string "looks" like an URL (begins with http:// or such-likes), without any real network check. The test is quite coarse though, and do not check things like %20.

Re: [B2.0d] CHttpManager : SlotsAvailable

Posted: 03 Jan 2013, 13:06
by spaii
Gugli wrote:Ooooops.... Just dizzy me making bugs... -_-'
:lol:

Ohhhh Yeeaahhh !!!

:thx: for your response Gugli

By the way, if i make a request with the same url used before, the response is cached and i have the old response.
It's not a problem, as you see in the portion of code above, i add Now in each request.
But, is this a bug or a feature ?

Another thing : i use a custom manialink for the menu of the stunters title pack (which is broken too, but i think you know that...)
When i use Http in this manialink, nothing happens.

Thx a lot, and HAPPY NEW YEAR !!! :D


Edit : posted the title pack menu issue : http://forum.maniaplanet.com/viewtopic. ... t=stunters

Re: [B2.0d] CHttpManager : SlotsAvailable

Posted: 05 Jan 2013, 13:18
by spaii