Handle timeouts in epoll
This commit is contained in:
@ -53,7 +53,10 @@ static int handle_request_cb(client_ctx_t *ctx) {
|
||||
|
||||
int handle_request(client_ctx_t *ctx) {
|
||||
if (ctx->c_keep_alive && ctx->s_keep_alive) {
|
||||
return async(&ctx->socket, ASYNC_WAIT_READ, 0, ctx, (void (*)(void *)) handle_request_cb, (void (*)(void *)) tcp_close);
|
||||
return async(&ctx->socket, ASYNC_WAIT_READ, 0, ctx,
|
||||
(void (*)(void *)) handle_request_cb,
|
||||
(void (*)(void *)) timeout_request,
|
||||
(void (*)(void *)) tcp_close);
|
||||
} else {
|
||||
tcp_close(ctx);
|
||||
return 0;
|
||||
@ -77,5 +80,8 @@ static int ws_handle_frame_cb(ws_ctx_t *ctx) {
|
||||
}
|
||||
|
||||
int ws_handle_frame(ws_ctx_t *ctx) {
|
||||
return async(ctx->socket, ASYNC_WAIT_READ, 0, ctx, (void (*)(void *)) ws_handle_frame_cb, (void (*)(void *)) ws_close);
|
||||
return async(ctx->socket, ASYNC_WAIT_READ, 0, ctx,
|
||||
(void (*)(void *)) ws_handle_frame_cb,
|
||||
(void (*)(void *)) ws_close,
|
||||
(void (*)(void *)) ws_close);
|
||||
}
|
||||
|
Reference in New Issue
Block a user