Skip to content

Commit 25485e0

Browse files
committed
Logic bug ? let's see
1 parent 820e2f6 commit 25485e0

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ www/rotationz.nl
44
www/rotationz.test
55
www/grassland.test
66
www/localhost/ddoc
7-
danode/server
8-
danode/server.exe
9-
danode/danode-test-default.exe
107
server
118
server.exe
9+
server.pdb
1210

1311
www/danny.test/
1412
www/localhost/123 123.txt

danode/cgi.d

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ class CGI : Payload {
109109
// Stream of message bytes, skips the script generated header since the webserver
110110
// parses the header and generates it's own
111111
const(char)[] bytes(ptrdiff_t from, ptrdiff_t maxsize = 1024) {
112-
if (from + endOfHeader > from)
113-
from += bodyStart;
112+
if (endOfHeader > 0) from += bodyStart;
114113
return(external.output(from)[0 .. to!ptrdiff_t(min(from+maxsize, $))]);
115114
}
116115

danode/response.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ struct Response {
5353
auto v = line.split(": ");
5454
if(v.length == 2) this.headers[v[0]] = chomp(v[1]);
5555
}
56-
if (status.code != 500) {
56+
if (status.code != 500 && scriptheader.length > 0) {
5757
auto htype = script.headerType();
5858
if (htype == HeaderType.FastCGI || htype == HeaderType.None) {
5959
hdr.put(format("%s %d %s\r\n", protocol, payload.statuscode, payload.statuscode.reason));
6060
}
6161
hdr.put(scriptheader);
6262
if(clength == -1) connection = "Close";
63-
return(hdr.data); // The script can communicate
63+
return(hdr.data);
6464
}
6565
if (connection != "No Request" && clength > -1) {
6666
custom(0, "KEEP", "script '%s' in keepalive mode connection '%s' (%s, %d)", script.command, connection, script.headerType(), clength);

0 commit comments

Comments
 (0)