From dc6966ec1c4d6cdb436ca5ce22d99fb51ec5259d Mon Sep 17 00:00:00 2001 From: ruti <> Date: Tue, 10 Sep 2024 22:52:15 +0300 Subject: [PATCH] ignore events until connection is established --- proxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proxy.c b/proxy.c index 42a876d..66c8efc 100644 --- a/proxy.c +++ b/proxy.c @@ -408,6 +408,10 @@ int create_conn(struct poolhd *pool, close(sfd); return -1; } + if (mod_etype(pool, val, 0) < 0) { + uniperror("mod_etype"); + return -1; + } val->pair = pair; pair->pair = val; #ifdef __NetBSD__ @@ -870,7 +874,8 @@ static inline int on_connect(struct poolhd *pool, struct eval *val, int e) } } else { - if (mod_etype(pool, val, POLLIN)) { + if (mod_etype(pool, val, POLLIN) || + mod_etype(pool, val->pair, POLLIN)) { uniperror("mod_etype"); return -1; }