92074c16a8
We can't take for granted that the hard limit for open files is big enough as to allow to delay closing sockets to a timer. Store the value of RTLIMIT_NOFILE we set at start, and use it to understand if we're approaching the limit with pending, spliced TCP connections. If that's the case, close sockets right away as soon as they're not needed, instead of deferring this task to a timer. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
15 lines
507 B
C
15 lines
507 B
C
/* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
* Copyright (c) 2022 Red Hat GmbH
|
|
* Author: Stefano Brivio <sbrivio@redhat.com>
|
|
*/
|
|
|
|
#define TCP_SPLICE_MAX_CONNS (128 * 1024)
|
|
|
|
struct tcp_splice_conn;
|
|
|
|
void tcp_sock_handler_splice(struct ctx *c, union epoll_ref ref,
|
|
uint32_t events);
|
|
void tcp_splice_destroy(struct ctx *c, struct tcp_splice_conn *conn);
|
|
void tcp_splice_init(struct ctx *c);
|
|
void tcp_splice_timer(struct ctx *c, struct timespec *now);
|
|
void tcp_splice_defer_handler(struct ctx *c);
|