Properly initialize accepted stream sockets.

This commit is contained in:
Sönke Ludwig 2016-10-24 08:17:59 +02:00
parent d6e77adfc5
commit 39afb2ad21

View file

@ -313,6 +313,7 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets
setSocketNonBlocking(cast(SocketFD)sockfd);
auto fd = cast(StreamSocketFD)sockfd;
m_loop.initFD(fd);
m_loop.m_fds[fd].specific = StreamSocketSlot.init;
m_loop.registerFD(fd, EventMask.read|EventMask.write|EventMask.status);
//print("accept %d", sockfd);
m_loop.m_fds[listenfd].streamListen.acceptCallback(cast(StreamListenSocketFD)listenfd, fd);