mirror of https://github.com/adamdruppe/arsd.git
would never answer the browser if cgi threw
This commit is contained in:
parent
23da5a5bf4
commit
5b38267e09
6
httpd.d
6
httpd.d
|
@ -78,6 +78,8 @@ class HttpdConnection(CustomCgi) : Connection /* if(is(CustomCgi : Cgi)) */ {
|
||||||
state = 0;
|
state = 0;
|
||||||
separator = "\r\n";
|
separator = "\r\n";
|
||||||
|
|
||||||
|
// writeln("FINISHED");
|
||||||
|
|
||||||
scope(exit) {
|
scope(exit) {
|
||||||
if(closeConnection)
|
if(closeConnection)
|
||||||
disconnect();
|
disconnect();
|
||||||
|
@ -106,6 +108,8 @@ class HttpdConnection(CustomCgi) : Connection /* if(is(CustomCgi : Cgi)) */ {
|
||||||
} catch(Throwable e) {
|
} catch(Throwable e) {
|
||||||
cgi.setResponseStatus("500 Internal Server Error");
|
cgi.setResponseStatus("500 Internal Server Error");
|
||||||
cgi.write(e.toString());
|
cgi.write(e.toString());
|
||||||
|
cgi.close();
|
||||||
|
cgi.dispose();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -114,6 +118,8 @@ class HttpdConnection(CustomCgi) : Connection /* if(is(CustomCgi : Cgi)) */ {
|
||||||
override void onDataReceived(){
|
override void onDataReceived(){
|
||||||
auto a = read();
|
auto a = read();
|
||||||
|
|
||||||
|
// writeln("data received ", state, "\n", cast(string) a);
|
||||||
|
|
||||||
more:
|
more:
|
||||||
switch(state) {
|
switch(state) {
|
||||||
default: assert(0);
|
default: assert(0);
|
||||||
|
|
Loading…
Reference in New Issue