[B2.0d] CHttpManager : SlotsAvailable

Moderator: NADEO

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

[B2.0d] CHttpManager : SlotsAvailable

Post 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);					
		}
	}
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: [B2.0d] CHttpManager : SlotsAvailable

Post 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.
--
(>~_~)> ═╦═ ╔╦╗ <(~_~<)
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [B2.0d] CHttpManager : SlotsAvailable

Post 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
User avatar
spaii
Posts: 1075
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: [B2.0d] CHttpManager : SlotsAvailable

Post by spaii »

Locked

Return to “Maniaplanet Reports”

Who is online

Users browsing this forum: No registered users and 1 guest