-#include "squid.h"
+/*
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
// Author: Jens-S. V?ckler <voeckler@rvs.uni-hannover.de>
//
// File: socket.hh
// Revision 1.1 1998/08/13 21:52:55 voeckler
// Initial revision
//
-//
-#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__)
-#pragma implementation
-#endif
+#include "squid.h"
#include "socket.hh"
+
+#include <cerrno>
+#include <cstring>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
#include <unistd.h>
#include "convert.hh"
}
int
-setSocketNoDelay( int sockfd, bool nodelay )
+setSocketNoDelay( int sockfd, bool)
// purpose: get state of the TCP_NODELAY of the socket
// paramtr: sockfd (IN): socket descriptor
// nodelay (IN): true, if TCP_NODELAY is to be set, false otherwise.
}
if ( reuse ) {
- int reuse = 1;
+ int opt = 1;
if ( setsockopt( sockfd, SOL_SOCKET, SO_REUSEADDR,
- (char*) &reuse, sizeof(int) ) == -1) {
+ (char*) &opt, sizeof(int) ) == -1) {
perror( "setsockopt( SO_REUSEADDR )" );
close( sockfd );
return -1;
return sockfd;
}
+