X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=server%2Feventl.c;h=be99c322ca9b12ada0dd42e82b929fe55eb4b930;hb=bceb14af6e76b53d2dcb49af2c981d4bbfc20e3a;hp=1780a0181e8bae3788d2860af4562ce226ef4f39;hpb=a4d2b1d22b135d53d88c96a452a62d3009197d29;p=yaz-moved-to-github.git diff --git a/server/eventl.c b/server/eventl.c index 1780a01..be99c32 100644 --- a/server/eventl.c +++ b/server/eventl.c @@ -1,10 +1,23 @@ /* - * Copyright (C) 1994, Index Data I/S - * All rights reserved. + * Copyright (c) 1995, Index Data + * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: eventl.c,v $ - * Revision 1.4 1995-03-14 16:59:48 quinn + * Revision 1.8 1995-05-16 08:51:01 quinn + * License, documentation, and memory fixes + * + * Revision 1.7 1995/03/27 15:02:01 quinn + * Added some includes for better portability + * + * Revision 1.6 1995/03/27 08:34:21 quinn + * Added dynamic server functionality. + * Released bindings to session.c (is now redundant) + * + * Revision 1.5 1995/03/15 08:37:41 quinn + * Now we're pretty much set for nonblocking I/O. + * + * Revision 1.4 1995/03/14 16:59:48 quinn * Bug-fixes * * Revision 1.3 1995/03/14 11:30:14 quinn @@ -23,10 +36,19 @@ #include #include #include +#include +#include #include -IOCHAN iochans = 0; +#include + +static IOCHAN iochans = 0; + +IOCHAN iochan_getchan(void) +{ + return iochans; +} IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags) { @@ -78,22 +100,24 @@ int event_loop() continue; return 1; } - if (!res) - continue; - for (p = iochans; p; p = nextp) + for (p = iochans; p; p = p->next) { int force_event = p->force_event; p->force_event = 0; - nextp = p->next; if (FD_ISSET(p->fd, &in) || force_event == EVENT_INPUT) (*p->fun)(p, EVENT_INPUT); - if (!p->destroyed && (FD_ISSET(p->fd, &in) || + if (!p->destroyed && (FD_ISSET(p->fd, &out) || force_event == EVENT_OUTPUT)) (*p->fun)(p, EVENT_OUTPUT); if (!p->destroyed && (FD_ISSET(p->fd, &except) || force_event == EVENT_EXCEPT)) (*p->fun)(p, EVENT_EXCEPT); + } + for (p = iochans; p; p = nextp) + { + nextp = p->next; + if (p->destroyed) { IOCHAN tmp = p, pr;