commit 24d362cd67c3eba1ce1a6af67eb71b6fce469411 from: Omar Polo date: Sat Jun 12 13:42:43 2021 UTC explicitly use c->fd instead of fd Yep, fd should be the file descriptor, but for lazyness when manually calling the function sometimes we supply 0 as fd and event. Instead of fixing the usage, do as other of such functions do in this circumstances: use c->fd. commit - 89c88caa3c023d5194e0d572ae99ab006557cbf3 commit + 24d362cd67c3eba1ce1a6af67eb71b6fce469411 blob - 7172f30116bb7f3293d686d18cb3e98d62ac14f3 blob + 5bc0ff5f0758f85353018dd8e255f45b49c72b3f --- server.c +++ server.c @@ -1109,10 +1109,10 @@ close_conn(int fd, short ev, void *d) switch (tls_close(c->ctx)) { case TLS_WANT_POLLIN: - yield_read(fd, c, &close_conn); + yield_read(c->fd, c, &close_conn); return; case TLS_WANT_POLLOUT: - yield_read(fd, c, &close_conn); + yield_read(c->fd, c, &close_conn); return; }