Skip to content

Commit

Permalink
proxy: notifier eviction made conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Oct 10, 2024
1 parent 67b98ed commit 39586f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
16 changes: 14 additions & 2 deletions common/notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 &&
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion common/sockproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 39586f2

Please sign in to comment.