diff options
Diffstat (limited to 'functions.c')
-rw-r--r-- | functions.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/functions.c b/functions.c index fcb1799..cd56904 100644 --- a/functions.c +++ b/functions.c @@ -476,7 +476,7 @@ int sendtoclient(int fd, char *strsrc, struct client *clients, struct settings * } debugprint(DEBUG_SOME, "sendtoclient(): sending \"%s\" (length %zd) to client with fd %d.\n", str, strlen(str), fd); - if (socksend(clients[i].ssl, str, strlen(str), settings->clienttls) == -1) { + if (socksend(clients[i].ssl, str, strlen(str), settings->clienttls) < 0) { debugprint(DEBUG_CRIT, "error: sendtoclient() socksend() error sending to client with fd '%d', errno '%d'.\n", fd, errno); return 0; } @@ -545,7 +545,7 @@ int sendtoallclients(struct client *clients, char *strsrc, int except, struct se continue; } debugprint(DEBUG_SOME, "sendtoallclients(): %s: sending '%s' to client with fd %d.\n", sendertype, str, clients[i].fd); - if (socksend(clients[i].ssl, str, strlen(str), settings->clienttls) == -1) { + if (socksend(clients[i].ssl, str, strlen(str), settings->clienttls) < 0) { debugprint(DEBUG_CRIT, "error: sendtoallclients() socksend() error sending to client with fd '%d', errno '%d'.\n", clients[i].fd, errno); } } @@ -588,18 +588,18 @@ int sendtoserver(SSL *server_ssl, char *strsrc, int str_len, int clientfd, struc // Found client in array, check authentication status if (!clients[i].authed) { debugprint(DEBUG_SOME, "sendtoserver(): skipping unauthenticated client with fd %d.\n", clients[i].fd); - return 1; + return 0; } } } debugprint(DEBUG_SOME, "sendtoserver(): sending '%s' to IRC server (length %d).\n", str, str_len); - if (socksend(server_ssl, str, str_len, settings->servertls) == -1) { + if (socksend(server_ssl, str, str_len, settings->servertls) < 0) { debugprint(DEBUG_CRIT, "error: sendtoserver() socksend() error sending to server, errno '%d'.\n", clientfd, errno); - return 1; + return 0; } - return 0; + return 1; } // Disconnect the client fd "fd" by close()ing it and remove |