Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] [2.0.15] setHttpHost() returns 1 for any* host name

Author
Message
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 23rd Dec 2015 05:21
* exception is empty string
* for any host name which I've tried
* even for '-1'

it might be some error code instead like:
-1 host is not found
-2 host does not response
-3 bad host name (e.g. in case of '-1' like above or wrong IP[:port] like '256.0.0.0'[':-1'])
-4 bad certificate
-5 unathorized
etc.
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 23rd Dec 2015 05:25
forgot to say: in case of Ubuntu 14.04.
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 23rd Dec 2015 14:06
i agree.
i believe the error comes at connect, at request.
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 29th Feb 2016 17:28
it's still relevant for AppGameKit 2.0.17 on Ubuntu 14.04.



see screenshot in attachment.
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs

Attachments

Login to view attachments
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 29th Feb 2016 18:12
I don't think that SetHTTPHost() is supposed to check the connection and return 1/0 if the connection is working or not. Since this is a HTTP connection you are not maintaining a connection to a server. I could be wrong, but I think you have to send a request first.
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 29th Feb 2016 21:15 Edited at: 29th Feb 2016 21:15
Digital Awakening wrote: "you have to send a request first."

nope, see example in documentation.
Digital Awakening wrote: "I don't think that SetHTTPHost() is supposed to check the connection"

I want to get it supposed to be, but not only for checking the connection — for checking the correctness of host name and existing of host and even more. because 1) there's no point to return 1 or anything else otherwise and 2) we have no alternative method to check if host was set.
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 29th Feb 2016 23:15
They are using SendHTTPRequestASync() to do a reuest and GetHTTPResponseReady() to check when it's done. I think SetHTTPHost() will always return 1 since it can't fail. There's no connection to the server until SendHTTPRequestASync() is called.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 1st Mar 2016 00:44
Originally SetHTTPHost() was going to check the host, but since that would require a request of some kind we wait for the first request instead. Now that the command has been released with a return value we cannot remove it so it almost always returns 1, it will return 0 if the connection ID doesn't exist, or the host name is an empty string. Check the return value of GetHTTPResponseReady() instead, negative values mean there was an error connecting to the host.
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 1st Mar 2016 01:32 Edited at: 1st Mar 2016 01:32
Paul Johnston wrote: "Check the return value of GetHTTPResponseReady() instead, negative values mean there was an error connecting to the host."

ok, got it. is it same for GetHTTPFileComplete() and GetHTTPFileProgress() too?
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 1st Mar 2016 03:16
Quote: "is it same for GetHTTPFileComplete() and GetHTTPFileProgress() too?"

No, GetHTTPFileComplete and GetHTTPFileProgress will not return error codes, and I've just noticed that the documentation is wrong here as it says it returns the same as GetHTTPResponseReady, which it doesn't. Those two commands will only tell you if the download has finished, you should still check GetHTTPResponseReady for an error.

However I've also just noticed that on Windows this doesn't work properly and it will always return a negative value for file downloads even if they were successful, I'll get this fixed for the next version. Other platforms look like they work correctly.

Login to post a reply

Server time is: 2024-11-25 09:34:38
Your offset time is: 2024-11-25 09:34:38