mirror of https://github.com/adamdruppe/arsd.git
more compatibility fixes with my mac
This commit is contained in:
parent
0daa497977
commit
80700fc944
14
cgi.d
14
cgi.d
|
@ -6103,8 +6103,9 @@ void runAddonServer(EIS)(string localListenerName, EIS eis) if(is(EIS : EventIoS
|
||||||
epoll_event[64] events;
|
epoll_event[64] events;
|
||||||
} else {
|
} else {
|
||||||
pollfd[] pollfds;
|
pollfd[] pollfds;
|
||||||
pollfds ~= pollfd(sock, POLLIN);
|
|
||||||
IoOp*[int] ioops;
|
IoOp*[int] ioops;
|
||||||
|
pollfds ~= pollfd(sock, POLLIN);
|
||||||
|
ioops[sock] = acceptOp;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
|
@ -6123,6 +6124,7 @@ void runAddonServer(EIS)(string localListenerName, EIS eis) if(is(EIS : EventIoS
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int nfds = poll(pollfds.ptr, cast(int) pollfds.length, timeout_milliseconds);
|
int nfds = poll(pollfds.ptr, cast(int) pollfds.length, timeout_milliseconds);
|
||||||
|
size_t lastIdx = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nfds == 0) {
|
if(nfds == 0) {
|
||||||
|
@ -6134,7 +6136,14 @@ void runAddonServer(EIS)(string localListenerName, EIS eis) if(is(EIS : EventIoS
|
||||||
auto flags = events[idx].events;
|
auto flags = events[idx].events;
|
||||||
auto ioop = cast(IoOp*) events[idx].data.ptr;
|
auto ioop = cast(IoOp*) events[idx].data.ptr;
|
||||||
} else {
|
} else {
|
||||||
auto ioop = ioops[pollfds[idx].fd];
|
IoOp* ioop;
|
||||||
|
foreach(tidx, thing; pollfds[lastIdx .. $]) {
|
||||||
|
if(thing.revents) {
|
||||||
|
ioop = ioops[thing.fd];
|
||||||
|
lastIdx += tidx + 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//writeln(flags, " ", ioop.fd);
|
//writeln(flags, " ", ioop.fd);
|
||||||
|
@ -6174,6 +6183,7 @@ void runAddonServer(EIS)(string localListenerName, EIS eis) if(is(EIS : EventIoS
|
||||||
}
|
}
|
||||||
if(!found)
|
if(!found)
|
||||||
pollfds ~= pollfd(ns, POLLIN);
|
pollfds ~= pollfd(ns, POLLIN);
|
||||||
|
ioops[ns] = niop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue