diff --git a/httpd.d b/httpd.d index def1571..37dbb06 100644 --- a/httpd.d +++ b/httpd.d @@ -78,6 +78,8 @@ class HttpdConnection(CustomCgi) : Connection /* if(is(CustomCgi : Cgi)) */ { state = 0; separator = "\r\n"; + // writeln("FINISHED"); + scope(exit) { if(closeConnection) disconnect(); @@ -106,6 +108,8 @@ class HttpdConnection(CustomCgi) : Connection /* if(is(CustomCgi : Cgi)) */ { } catch(Throwable e) { cgi.setResponseStatus("500 Internal Server Error"); cgi.write(e.toString()); + cgi.close(); + cgi.dispose(); return; } @@ -114,6 +118,8 @@ class HttpdConnection(CustomCgi) : Connection /* if(is(CustomCgi : Cgi)) */ { override void onDataReceived(){ auto a = read(); + // writeln("data received ", state, "\n", cast(string) a); + more: switch(state) { default: assert(0);