more compatibility fixes with my mac

This commit is contained in:
Adam D. Ruppe 2019-07-08 21:04:41 -04:00
parent 0daa497977
commit 80700fc944
2 changed files with 13 additions and 2 deletions

14
cgi.d
View File

@ -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;
} }
} }
} }

View File

@ -20,6 +20,7 @@ version(without_openssl) {}
else { else {
version=use_openssl; version=use_openssl;
version=with_openssl; version=with_openssl;
version(older_openssl) {} else
version=newer_openssl; version=newer_openssl;
} }