Commit 7b6543d7 authored by Matthias Andree's avatar Matthias Andree

socket.c: Make SockKeepalive static, and readability variable renames.

parent 6b70292d
......@@ -207,7 +207,7 @@ static int handle_plugin(const char *host,
#endif /* HAVE_SOCKETPAIR */
/** Set socket to SO_KEEPALIVE. \return 0 for success. */
int SockKeepalive(int sock) {
static int SockKeepalive(int sock) {
int keepalive = 1;
return setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof keepalive);
}
......@@ -248,7 +248,7 @@ int UnixOpen(const char *path)
}
int SockOpen(const char *host, const char *service,
const char *plugin, struct addrinfo **ai0)
const char *plugin, struct addrinfo **ai_in)
{
struct addrinfo *ai, req;
int i, acterr = 0;
......@@ -266,7 +266,7 @@ int SockOpen(const char *host, const char *service,
req.ai_flags = AI_ADDRCONFIG;
#endif
i = fm_getaddrinfo(host, service, &req, ai0);
i = fm_getaddrinfo(host, service, &req, ai_in);
if (i) {
report(stderr, GT_("getaddrinfo(\"%s\",\"%s\") error: %s\n"),
host, service, gai_strerror(i));
......@@ -278,7 +278,7 @@ int SockOpen(const char *host, const char *service,
/* NOTE a Linux bug here - getaddrinfo will happily return 127.0.0.1
* twice if no IPv6 is configured */
i = -1;
for (ord = 0, ai = *ai0; ai; ord++, ai = ai->ai_next) {
for (ord = 0, ai = *ai_in; ai; ord++, ai = ai->ai_next) {
char buf[256]; /* hostname */
char pb[256]; /* service name */
int gnie; /* getnameinfo result code */
......@@ -338,8 +338,8 @@ int SockOpen(const char *host, const char *service,
break;
}
fm_freeaddrinfo(*ai0);
*ai0 = NULL;
fm_freeaddrinfo(*ai_in);
*ai_in = NULL;
if (i == -1) {
report(stderr, GT_("Connection errors for this poll:\n%s"), errbuf);
......@@ -1255,9 +1255,9 @@ int SSLOpen(int sock, char *mycert, char *mykey, const char *myproto, int certck
SSL_CIPHER const *sc;
int bitsmax, bitsused;
const char *ver;
const char *vers;
ver = SSL_get_version(_ssl_context[sock]);
vers = SSL_get_version(_ssl_context[sock]);
sc = SSL_get_current_cipher(_ssl_context[sock]);
if (!sc) {
......@@ -1265,7 +1265,7 @@ int SSLOpen(int sock, char *mycert, char *mykey, const char *myproto, int certck
} else {
bitsused = SSL_CIPHER_get_bits(sc, &bitsmax);
report(stdout, GT_("SSL/TLS: using protocol %s, cipher %s, %d/%d secret/processed bits\n"),
ver, SSL_CIPHER_get_name(sc), bitsused, bitsmax);
vers, SSL_CIPHER_get_name(sc), bitsused, bitsmax);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment