X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Feventl.c;h=cc8a6b98c452f35ba5c5f142c8ff925dbcd2fd1a;hb=245e16ffa5df630f1eb5f50bc674b422ccf1a1f0;hp=89ffb129b3adab018a46164db93a5ec25c728c23;hpb=41b3d6e76417912fda803543325e1edba21896ba;p=pazpar2-moved-to-github.git diff --git a/src/eventl.c b/src/eventl.c index 89ffb12..cc8a6b9 100644 --- a/src/eventl.c +++ b/src/eventl.c @@ -6,7 +6,7 @@ */ /* - * $Id: eventl.c,v 1.2 2007-01-08 12:43:41 adam Exp $ + * $Id: eventl.c,v 1.3 2007-03-28 12:05:18 marc Exp $ * Based on revision YAZ' server/eventl.c 1.29. */ @@ -17,11 +17,7 @@ #include #endif -#ifdef WIN32 -#include -#else -#include -#endif + #include #include #include @@ -30,10 +26,13 @@ #include #include #include -#include "eventl.h" #include -IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags) +#include "eventl.h" + + +IOCHAN iochan_create(int fd, struct sockaddr_in *addr_in, + IOC_CALLBACK cb, int flags) { IOCHAN new_iochan; @@ -41,6 +40,14 @@ IOCHAN iochan_create(int fd, IOC_CALLBACK cb, int flags) return 0; new_iochan->destroyed = 0; new_iochan->fd = fd; + + if(addr_in){ + new_iochan->addr_in.sin_family = addr_in->sin_family; + new_iochan->addr_in.sin_port = addr_in->sin_port; + new_iochan->addr_in.sin_addr = addr_in->sin_addr; + strncpy(new_iochan->addr_str, inet_ntoa(addr_in->sin_addr), 64); + } + new_iochan->flags = flags; new_iochan->fun = cb; new_iochan->force_event = 0;