static inline void handler_process_request(Handler *handler, int id, int fd, Connection *conn, bstring payload) { int rc = 0; if(conn == NULL) { debug("Ident %d (fd %d) is no longer connected.", id, fd); Handler_notify_leave(handler, id); } else { if(blength(payload) == 0) { rc = Register_disconnect(fd); check(rc != -1, "Register disconnect failed for: %d", fd); } else { int raw = conn->type != CONN_TYPE_MSG || handler->raw; rc = deliver_payload(raw, fd, conn, payload); check(rc != -1, "Failed to deliver to connection %d on socket %d", id, fd); } } return; error: Register_disconnect(fd); // return ignored return; }
static inline void handler_process_request(Handler *handler, int id, int fd, Connection *conn, bstring payload) { int rc = 0; check(conn != NULL, "You can't pass NULL conn to this anymore."); if(blength(payload) == 0) { rc = Connection_deliver_raw(conn,NULL); check(rc != -1, "Register disconnect failed for: %d", fd); } else { int raw = conn->type != CONN_TYPE_MSG || handler->raw; rc = deliver_payload(raw, fd, conn, payload); check(rc != -1, "Failed to deliver to connection %d on socket %d", id, fd); } return; error: Register_disconnect(fd); // return ignored return; }