ID:1789809
 
BYOND Version:507
Operating System:Linux
Web Browser:Firefox 35.0
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

The entire 507 beta series has broken DMCGI support. DreamDaemon no longer outputs anything when the -cgi argument is passed, with no indication why. This causes the browser to spit out an internal server error (since there are no headers being sent)

Numbered Steps to Reproduce Problem:

Update your server from a 506 build to any 507 build.

Watch all existing DMCGI stop working.

Code Snippet (if applicable) to Reproduce Problem:
CGI
Topic()
..()
usr << "Hello world!"


Expected Results:

"Hello world" to output to the browser.

Actual Results:

Empty output from DreamDaemon, resulting in the browser spitting out a '500 Internal Server Error', caused by lack of headers and content.

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

When does the problem NOT occur?

When using 506.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Everything before the first build of 507 works.

Workarounds:

Use 506.
To update this; Fushimi noted that the issue happens when using browse() to output, but not when using direct output.

CGI
Topic(href)
if(href == "browse")
usr << browse("Hello world! (using browse())")
else
usr << "Hello world (not using browse())"


http://nadrew.com/dmcgi.dmb
http://nadrew.com/dmcgi.dmb?browse

The non-browse() version works as expected, the browse() version fails to output anything (even the HTML headers).


Ironically, I think this is caused by a bug with browse() I reported early on in the 507 beta process that got fixed (I can only assume this bug was caused by said fix).
In addition, world.Export() will fail to get the actual content of any webpage linked.
The STATUS, DATE, CONTENT-TYPE headers contain the expected data, whereas the CONTENT header is just blank.

I have tested hitting a .php script, but nothing would get read, also tried with a text file, yet nothing to read.

            var results[] = world.Export("http://www.falconeyegaming.com/releases/servermanager/announcements/_getAnnounces.php?action=[_hash]")
results = world.Export("http://www.falconeyegaming.com/releases/servermanager/announcements/_announcements.txt")
if(!results)
return "No announcements were found...."
usr << "THE RESULTS: [results["CONTENT"]]"
results = parseAnnounces(results["CONTENT"], usr, href_list)
if(results == "No announcements were found.")

html = {"[results]"}
else
for(var/id in results)
if(!results[id]["title"] || !results[id]["content"])
continue
usr<<"foundone"
html += {"<div class="block">
<div class="block title nested">
[results[id]["title"]]
</div>
<div class="block content nested">
[results[id]["content"]]
<!-- <a href="?" class="block more">Read More...</a> -->
</div>
</div>"}


Sample of the approach, as a side note, this works as expected in DS.