Close all connections on exit

This commit is contained in:
2023-01-04 00:40:09 +01:00
parent d8fd552b40
commit c67edd4195
8 changed files with 54 additions and 22 deletions

@ -14,7 +14,6 @@
#include <string.h>
#include <sys/socket.h>
#include <unistd.h>
#include <poll.h>
int sock_enc_error(sock *s) {
@ -142,7 +141,7 @@ long sock_splice_chunked(sock *dst, sock *src, void *buf, unsigned long buf_len)
int sock_close(sock *s) {
int e = errno;
if ((int) s->enc && s->ssl != NULL) {
if (s->enc && s->ssl != NULL) {
if (s->_last_ret >= 0) SSL_shutdown(s->ssl);
SSL_free(s->ssl);
s->ssl = NULL;