Use different accept handlers for TCP and unix socket connections

This commit is contained in:
Pieter Noordhuis
2010-10-13 18:34:24 +02:00
parent 893819801d
commit ab17b909fe
5 changed files with 68 additions and 26 deletions

View File

@ -820,9 +820,9 @@ void initServer() {
server.unixtime = time(NULL);
aeCreateTimeEvent(server.el, 1, serverCron, NULL, NULL);
if (server.ipfd > 0 && aeCreateFileEvent(server.el,server.ipfd,AE_READABLE,
acceptHandler,NULL) == AE_ERR) oom("creating file event");
acceptTcpHandler,NULL) == AE_ERR) oom("creating file event");
if (server.sofd > 0 && aeCreateFileEvent(server.el,server.sofd,AE_READABLE,
acceptHandler,NULL) == AE_ERR) oom("creating file event");
acceptUnixHandler,NULL) == AE_ERR) oom("creating file event");
if (server.appendonly) {
server.appendfd = open(server.appendfilename,O_WRONLY|O_APPEND|O_CREAT,0644);