commit 38a6fd3d7baf09b83ee89a43574dec61146a08b9 from: Omar Polo date: Fri Jan 28 21:49:15 2022 UTC cache listener flags in struct client this saves us from the small chance that a client accepted before reconf uses the flags from a listener post reconf. commit - ac796d32181ae09d4225fa5bf3598d4d54d2b8cf commit + 38a6fd3d7baf09b83ee89a43574dec61146a08b9 blob - 8ec42aa40d8d39e7adba771bda2f402b047b1e88 blob + ad131f13591fff2762725e83e48054cd4c14cb87 --- kamid/listener.c +++ kamid/listener.c @@ -55,6 +55,7 @@ SPLAY_HEAD(clients_tree_id, client) clients; struct client { uint32_t id; uint32_t lid; + uint32_t lflags; uint32_t msize; int fd; struct tls *ctx; @@ -365,8 +366,7 @@ listener_dispatch_main(int fd, short event, void *d) evbuffer_unfreeze(client->bev->output, 1); #endif - listen = listen_by_id(client->lid); - if (listen->flags & L_TLS) { + if (client->lflags & L_TLS) { event_set(&client->bev->ev_read, client->fd, EV_READ, client_tls_readcb, client->bev); event_set(&client->bev->ev_write, client->fd, @@ -628,6 +628,7 @@ handle_accept(int fd, short ev, void *data) c = xcalloc(1, sizeof(*c)); c->msize = MSIZE9P; c->lid = listen->id; + c->lflags = listen->flags; c->iev.ibuf.fd = -1; if (tls_accept_socket(listen->ctx, &c->ctx, s) == -1) {