diff -r f1cff81e425a -r 3578977d29a3 src/server/daemon/sessionhandler.c --- a/src/server/daemon/sessionhandler.c Tue Jun 25 15:45:13 2013 +0200 +++ b/src/server/daemon/sessionhandler.c Tue Jun 25 22:18:59 2013 +0200 @@ -110,12 +110,18 @@ return NULL; } +void basic_keep_alive(SessionHandler *handler, Connection *conn) { + +} + + /* ----- event session handler ----- */ SessionHandler* create_event_session_handler() { EventSessionHandler *handler = malloc(sizeof(EventSessionHandler)); handler->eventhandler = get_default_event_handler(); handler->sh.enqueue_connection = evt_enq_conn; + handler->sh.keep_alive = evt_keep_alive; return (SessionHandler*)handler; } @@ -280,3 +286,20 @@ return 0; } + +void evt_keep_alive(SessionHandler *handler, Connection *conn) { + // TODO: set timeout + + /* TODO: + * Don't just re-enqueue the connection + * create a evt_req_init function which does most of the evt_enq_conn stuff + * but don't poll. + * evt_keep_alive should poll and if an event occurs: + * evt_req_init + * evt_request_input + * evt_enq_conn should do: + * evt_req_init + * ev_pollin + */ + evt_enq_conn(handler, conn); +}