hirc

IRC client
Log | Files | Refs

commit b54d30c012780e7f107bba63b56a7e119fac7667
parent 15e9b6285b887c18798d576a221d667380e1de2c
Author: hhvn <dev@hhvn.uk>
Date:   Sun, 16 Jan 2022 00:18:21 +0000

s/main.c s/serv.c: fix TLS ifdefs

Diffstat:
Msrc/main.c | 2+-
Msrc/serv.c | 2++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c @@ -263,8 +263,8 @@ ircprintf(struct Server *server, char *format, ...) { ret = tls_write(server->tls_ctx, msg, strlen(msg)); } while (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT); else - ret = write(server->wfd, msg, strlen(msg)); #endif /* TLS */ + ret = write(server->wfd, msg, strlen(msg)); if (ret == -1 && server->status == ConnStatus_connected) { serv_disconnect(server, 1, NULL); diff --git a/src/serv.c b/src/serv.c @@ -345,8 +345,10 @@ serv_disconnect(struct Server *server, int reconnect, char *msg) { if (msg) ircprintf(server, "QUIT %s\r\n", msg); +#ifdef TLS if (server->tls) tls_close(server->tls_ctx); +#endif /* TLS */ shutdown(server->rfd, SHUT_RDWR); shutdown(server->wfd, SHUT_RDWR); close(server->rfd);