Remove sock_close and sock_shutdown 'portability' defs.
authorArt Cancro <ajc@citadel.org>
Tue, 2 Jan 2024 18:07:33 +0000 (13:07 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 2 Jan 2024 18:07:33 +0000 (13:07 -0500)
citadel/server/clientsocket.c
citadel/server/clientsocket.h
citadel/server/modules/spam/serv_spam.c

index 78e5be9c11a3ead18b490caea136672c4ab43e50..c3ce905b5cfb32977cfe4b29a7f048e9fd074bfe 100644 (file)
@@ -182,7 +182,7 @@ int sock_write_timeout(int *sock, const char *buf, int nbytes, int timeout) {
                retval = write(*sock, &buf[bytes_written],
                               nbytes - bytes_written);
                if (retval < 1) {
-                       sock_close(*sock);
+                       close(*sock);
                        *sock = -1;
                        return (-1);
                }
index cc275e1a53083dd16047b2c2add12ad42e079805..0fe45fa3e79cd927687a276f7cd1b3e67be2527d 100644 (file)
@@ -1,14 +1,9 @@
 // Header file for TCP client socket library
 //
-// Copyright (c) 1987-2012 by the citadel.org team
+// Copyright (c) 1987-2024 by the citadel.org team
 //
-//  This program is open source software; you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License version 3.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
+// This program is open source software.  Use, duplication, or disclosure
+// is subject to the terms of the GNU General Public License version 3.
 
 int sock_connect(char *host, char *service);
 int sock_write(int *sock, const char *buf, int nbytes);
@@ -19,14 +14,5 @@ int CtdlSockGetLine(int *sock, StrBuf *Target, int nSec);
 int sock_puts(int *sock, char *buf);
 int socket_read_blob(int *Socket, StrBuf * Target, int bytes, int timeout);
 
-
-/* 
- * This looks dumb, but it's being done for future portability
- */
-#define sock_close(sock)               close(sock)
-#define sock_shutdown(sock, how)       shutdown(sock, how)
-
-/* 
- * Default timeout for client sessions
- */
+// Default timeout for client sessions
 #define CLIENT_TIMEOUT         600
index 88e0a4b3e75dbb1a901bc261d36e0ad676e4c5cc..863bd002043871c9edc28c6f9381277eb9340d7c 100644 (file)
@@ -87,8 +87,9 @@ int spam_assassin(struct CtdlMessage *msg, struct recptypes *recp) {
        FreeStrBuf(&msgtext);
 
        // Close one end of the socket connection; this tells SpamAssassin that we're done.
-       if (sock != -1)
-               sock_shutdown(sock, SHUT_WR);
+       if (sock != -1) {
+               shutdown(sock, SHUT_WR);
+       }
        
        // Response
        syslog(LOG_DEBUG, "Awaiting response\n");