mirror of https://github.com/adamdruppe/arsd.git
allow delegate as well as function for fiber
This commit is contained in:
parent
ce4c8a3875
commit
2322315708
6
cgi.d
6
cgi.d
|
@ -4036,13 +4036,17 @@ void handleCgiRequest(alias fun, CustomCgi = Cgi, long maxContentLength = defaul
|
||||||
version(cgi_use_fiber)
|
version(cgi_use_fiber)
|
||||||
class CgiFiber : Fiber {
|
class CgiFiber : Fiber {
|
||||||
this(void function(Socket) handler) {
|
this(void function(Socket) handler) {
|
||||||
|
this(delegate void(Socket s) { handler(s); });
|
||||||
|
}
|
||||||
|
|
||||||
|
this(void delegate(Socket) handler) {
|
||||||
this.handler = handler;
|
this.handler = handler;
|
||||||
// FIXME: stack size
|
// FIXME: stack size
|
||||||
super(&run);
|
super(&run);
|
||||||
}
|
}
|
||||||
|
|
||||||
Socket connection;
|
Socket connection;
|
||||||
void function(Socket) handler;
|
void delegate(Socket) handler;
|
||||||
|
|
||||||
void run() {
|
void run() {
|
||||||
handler(connection);
|
handler(connection);
|
||||||
|
|
Loading…
Reference in New Issue