]> PatchyGit - patchyircd.git/commitdiff
fix errno output in recvProc
authorEgor <egor@patchysicp.xyz>
Wed, 11 May 2022 12:43:54 +0000 (15:43 +0300)
committerEgor <egor@patchysicp.xyz>
Wed, 11 May 2022 12:43:54 +0000 (15:43 +0300)
net.c

diff --git a/net.c b/net.c
index 850ef4d..d027f88 100644 (file)
--- a/net.c
+++ b/net.c
@@ -85,8 +85,8 @@ void recvProc(struct client_data *cl) {
                                        return;
                                // Error
                                case -1:
-                                       killConnection(cl, false);
                                        fprintf(stderr, "tls_read: %s\n", tls_error(cl->cctx));
+                                       killConnection(cl, false);
                                        return;
                                case TLS_WANT_POLLIN:
                                        return;
@@ -106,8 +106,8 @@ void recvProc(struct client_data *cl) {
                                // Error
                                case -1:
                                        if(!net_wouldblock()){
-                                               killConnection(cl, false);
                                                net_perror("RECV");
+                                               killConnection(cl, false);
                                        }
                                        return;
                        }