Skip to content

Commit

Permalink
ignore events until connection is established
Browse files Browse the repository at this point in the history
  • Loading branch information
ruti committed Sep 10, 2024
1 parent 02a9e04 commit dc6966e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit dc6966e

Please sign in to comment.