diff --git a/cgi.d b/cgi.d index d05c100..6b979b6 100644 --- a/cgi.d +++ b/cgi.d @@ -3770,11 +3770,15 @@ class ListeningConnectionManager { } semaphore.notify(); + bool hasAnyRunning; foreach(thread; threads) { if(!thread.isRunning) { thread.join(); - } + } else hasAnyRunning = true; } + + if(!hasAnyRunning) + break; } // FIXME: i typically stop this with ctrl+c which never @@ -3876,7 +3880,7 @@ class ConnectionThread : Thread { } try dg(socket); - catch(Exception e) + catch(Throwable e) socket.close(); } } @@ -5950,6 +5954,8 @@ private string beautify(string name, char space = ' ', bool allLowerCase = false } lastWasCap = true; + } else { + lastWasCap = false; } if(shouldSpace) { @@ -6260,9 +6266,11 @@ auto callFromCgi(alias method, T)(T dg, Cgi cgi) { --- class MyPresenter : WebPresenter!(MyPresenter) { + @Override void presentSuccessfulReturnAsHtml(T : CustomType)(Cgi cgi, T ret) { // present the CustomType } + @Override void presentSuccessfulReturnAsHtml(T)(Cgi cgi, T ret) { // handle everything else via the super class, which will call // back to your class when appropriate @@ -6273,6 +6281,11 @@ auto callFromCgi(alias method, T)(T dg, Cgi cgi) { +/ class WebPresenter(CRTP) { + + /// A UDA version of the built-in `override`, to be used for static template polymorphism + /// If you override a plain method, use `override`. If a template, use `@Override`. + enum Override; + string script() { return ` `; @@ -6290,7 +6303,8 @@ class WebPresenter(CRTP) { } string genericFormStyling() { - return ` + return +q"css table.automatic-data-display { border-collapse: collapse; border: solid 1px var(--mild-border); @@ -6332,28 +6346,29 @@ class WebPresenter(CRTP) { .add-array-button { } - `; +css"; } string genericSiteStyling() { - return ` + return +q"css * { box-sizing: border-box; } html, body { margin: 0px; } body { font-family: sans-serif; } - #header { + header { background: var(--accent-color); height: 64px; } - #footer { + footer { background: var(--accent-color); height: 64px; } - #main-site { + #site-container { display: flex; } - #container { + main { flex: 1 1 auto; order: 2; min-height: calc(100vh - 64px - 64px); @@ -6365,29 +6380,31 @@ class WebPresenter(CRTP) { order: 1; background: var(--sidebar-color); } - `; +css"; } import arsd.dom; Element htmlContainer() { - auto document = new Document(` + auto document = new Document(q"html +