ID:2176129
 
BYOND Version:511.1363
Operating System:Linux
Web Browser:Chrome 54.0.2840.100
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary: world.Export treats any HTTP status code that is *not* 200 as an error, including 204.

Numbered Steps to Reproduce Problem: Run code below pointed at any service that will return HTTP 204.

Code Snippet (if applicable) to Reproduce Problem:
/world/New()
Export("http://localhost:4000/")

while running:
nc -Cl 4000

in a terminal; when BYOND's HTTP request appears, type into the terminal:
HTTP/1.1 204 No Content

and then press <Enter> twice.

Alternatively, run the following code, which points at a URL on my webserver that I've configured to return a 204:
/world/New()
Export("http://gn32.uk/204")


Expected Results: A successful world.Export call, returning either null or ""

Actual Results: BUG: Http error: HTTP server returned unexpected status: 204 No Content

Does the problem occur:
Every time? Or how often? Every time
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur? N/A

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Unknown

Workarounds: Don't use 204 as a return code for BYOND's requests.


Side note: Perhaps world.Export() could return an object representing the HTTP request, complete with status code, body, and headers? That way any status code is acceptable, it just needs to be handled in user code.
GinjaNinja32 wrote:
Side note: Perhaps world.Export() could return an object representing the HTTP request, complete with status code, body, and headers? That way any status code is acceptable, it just needs to be handled in user code.


http://www.byond.com/forum/?post=117064
;(
libcurl when yo

#LibcurlFor512
We using hashtags?

#CEFFor512
#UTF-8For512
#OpenSourceFor512
#LanguageNotDesignedByMonkeysFor512
#BetterCApiFor512
I found the code that's responsible for the 204 handling, but I haven't figured out what I want to do with it yet.

Actually the whole libcurl thing has been thrown into a bit of confusion because I found out it's client-only and won't allow secure servers for the webclient, which was one of the things I was very much hoping for. (There's another lib that does that, but I kind of hate to add two extra libs here. I'm still mulling it over.)
Pretty sure you'd just need OpenSSL for the webclient on the Daemon server side for a secure connection.

Libcurl would be great to have for DreamSeeker clients and the server itself too though. Don't see why it wouldn't work.
In response to Lummox JR
Lummox JR wrote:
I found the code that's responsible for the 204 handling, but I haven't figured out what I want to do with it yet.

Actually the whole libcurl thing has been thrown into a bit of confusion because I found out it's client-only and won't allow secure servers for the webclient, which was one of the things I was very much hoping for. (There's another lib that does that, but I kind of hate to add two extra libs here. I'm still mulling it over.)

why wouldn't it allow secure servers for the webclient; what do you mean client only?
libcurl is for retrieving information
you'd embed it with something like openssl which you could use to set up HTTPS sockets, but that also isn't very feasible because you'd have to sign certificates for everyone. Good luck getting a CA to do that for you, self signed certificates would result in the connection being auto aborted
somepotato, he is also trying to fulfill ID:1974046


In response to Somepotato
Somepotato wrote:
why wouldn't it allow secure servers for the webclient; what do you mean client only?
libcurl is for retrieving information

That's exactly what I mean by client-only. Libcurl is acting as a client, not as a server.
Libcurl is a client, plain and simple. You can use OpenSSL it would require for HTTPS to add SSL support to the websockets.
I'd like to say you won't be able to do it though because you'd have to sign certificates for all BYOND servers using a valid certificate authority, and noone is going to do that for you. You'll have to require people provide their own certificates and allow people to point the webclient to a domain name instead of an IP.
Welcome to 9 days ago.

Lummox JR Wrote:
Actually the whole libcurl thing has been thrown into a bit of confusion because I found out it's client-only and won't allow secure servers for the webclient, which was one of the things I was very much hoping for.

The point is that before 9 days ago, lummox had thought libcurl had some server capabilities.

I'm not entirely sure why you are trying to convince him it's a client now....
In response to MrStonedOne
MrStonedOne wrote:
Welcome to 9 days ago.

Lummox JR Wrote:
Actually the whole libcurl thing has been thrown into a bit of confusion because I found out it's client-only and won't allow secure servers for the webclient, which was one of the things I was very much hoping for.

The point is that before 9 days ago, lummox had thought libcurl had some server capabilities.

I'm not entirely sure why you are trying to convince him it's a client now....

Well, good thing I wasn't trying to convince him it's a client now.
In response to Somepotato
Somepotato wrote:
Libcurl is a client, plain and simple.