From 69f5b46c2c30b88ee8f784163f175ef305402914 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Fri, 18 Apr 2014 09:55:00 -0700 Subject: Don't die insensibly --- src/mmo/socket.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mmo/socket.cpp b/src/mmo/socket.cpp index 53a891c..ef70b67 100644 --- a/src/mmo/socket.cpp +++ b/src/mmo/socket.cpp @@ -57,6 +57,22 @@ std::array, FD_SETSIZE> session; #pragma GCC diagnostic pop Session::Session(SessionIO io, SessionParsers p) +: created() +, connected() +, eof() +, timed_close() +, rdata(), wdata() +, max_rdata(), max_wdata() +, rdata_size(), wdata_size() +, rdata_pos() +, client_ip() +, func_recv() +, func_send() +, func_parse() +, func_delete() +, for_inferior() +, session_data() +, fd() { set_io(io); set_parsers(p); @@ -154,6 +170,11 @@ void send_from_fifo(Session *s) } } +static +void nothing_delete(Session *s) +{ + (void)s; +} static void connect_client(Session *ls) @@ -268,7 +289,7 @@ Session *make_listen_port(uint16_t port, SessionParsers inferior) set_session(fd, make_unique( SessionIO{func_recv: connect_client, func_send: nullptr}, - SessionParsers{func_parse: nullptr, func_delete: nullptr})); + SessionParsers{func_parse: nullptr, func_delete: nothing_delete})); Session *s = get_session(fd); s->for_inferior = inferior; s->fd = fd; -- cgit v1.2.3-60-g2f50