1
0
forked from aniani/gmnisrv

disconnect_client: clean up bios

This commit is contained in:
Drew DeVault 2020-09-26 13:58:51 -04:00
parent 264c3b4602
commit 0d6eca2c79

View File

@ -185,9 +185,11 @@ disconnect_client(struct gmnisrv_server *server, struct gmnisrv_client *client)
client->path ? client->path : "(none)", client->path ? client->path : "(none)",
(int)client->status, client->meta); (int)client->status, client->meta);
} }
if (client->bio) {
BIO_free_all(client->bio);
}
close(client->sockfd); close(client->sockfd);
free(client->meta); free(client->meta);
// TODO: Close bios, body, etc
size_t index = (client - server->clients) / sizeof(struct gmnisrv_client); size_t index = (client - server->clients) / sizeof(struct gmnisrv_client);
memmove(client, &client[1], &server->clients[server->clientsz] - client); memmove(client, &client[1], &server->clients[server->clientsz] - client);
@ -426,7 +428,6 @@ sni_callback(SSL *ssl, int *al, void *arg)
} }
bool *run; bool *run;
static void static void
handle_sigint(int s, siginfo_t *i, void *c) handle_sigint(int s, siginfo_t *i, void *c)
{ {