YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
26 stars 8 forks source link

Empty HTTP responses cause async_load.status to be -1 #8464

Closed peardox closed 2 days ago

peardox commented 2 days ago

Description

The GML websocket stuff isn't compatible with socket.io so started writing my own...

TRhe first thing you have to do when creating a web socket is to upgrade the request (see the Async - HTTP) which is then sent back to the server f0or upgrading (this could fail - in which case polling would be used)

When the response comes back from socket.io the HTTP Status will be 101 - Switching Protocols

GML treats this as a bad request with status set to -1 even though the request was perfectly fine. The only option here is to completely ignore status and use the http_status then if it's 101 proceed

I suspect that other http_status codes that are prefectly fine also are treated as bad by status

OK, status may be for the idiots but in the case of something like http_request or the other more advanced functions isn't it fair to expect the dev knows what a bad http really looks like?

com.peardox.wsock.zip

Expected Change

http status 101 should not make status -1

Steps To Reproduce

  1. Start GameMaker
  2. Import Project
  3. Note - there is a socket.io server running on the suppied URL - just a dumb echo
  4. See the issue

How reliably can you recreate this issue using your steps above?

Always

Which version of GMRT are you reporting this issue for?

2024.8.1.171

Contact Us Package Attached?

Sample Project Added?

yoyo-danielc commented 2 days ago

This was recently fixed in GMS2 (https://github.com/YoYoGames/GameMaker-Bugs/issues/7811), will be fixed in the next GMRT release.

peardox commented 2 days ago

Cool - thx