From 39586f27cd8d51bcf40bf420ea242f7f46b31a9a Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Thu, 10 Oct 2024 21:45:16 +0900 Subject: [PATCH] proxy: notifier eviction made conditional --- common/notify.c | 16 ++++++++++++++-- common/sockproxy.c | 1 - 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/common/notify.c b/common/notify.c index 6ffd00c..aeb3e5a 100644 --- a/common/notify.c +++ b/common/notify.c @@ -303,6 +303,7 @@ notify_delete_ent__(void *ctx, int fd) return 0; } +#ifdef HAVE_NOTIFY_EVICT static int notify_delete_ent_evict__(void *ctx, int fd) { @@ -356,11 +357,20 @@ notify_delete_ent_evict__(void *ctx, int fd) return 0; } +#else + +static int +notify_delete_ent_evict__(void *ctx, int fd) +{ + return 0; +} + +#endif + int notify_delete_ent(void *ctx, int fd, int evict) { int rc; - notify_ctx_t *nctx = ctx; if (evict) { rc = notify_delete_ent_evict__(ctx, fd); @@ -413,6 +423,8 @@ notify_run(void *ctx, int thread) if (rc == 0) { int evict = 0; + +#ifdef HAVE_NOTIFY_EVICT for (i = 0; i < n_pfds; i++) { NOTI_LOCK(nctx); if (nctx->poll_ctx[thread].npfds[i].evict && @@ -422,7 +434,7 @@ notify_run(void *ctx, int thread) } NOTI_UNLOCK(nctx); } - +#endif if (!evict) { //log_trace("notify:poll:timeout (n_pfds %d)", n_pfds); continue; diff --git a/common/sockproxy.c b/common/sockproxy.c index 8bf5ca8..322ba8a 100644 --- a/common/sockproxy.c +++ b/common/sockproxy.c @@ -678,7 +678,6 @@ proxy_server_setup(int fd, uint32_t server, uint16_t port, uint8_t protocol) static int proxy_ssl_connect(int fd, void *ssl) { - fd_set fds; int to = 10; int err; int ssl_err;