diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2019-09-27 18:44:53 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2019-09-27 18:44:53 +0200 |
commit | 7b6543d77dae0d9dc8cf8f4b46a08698da28876e (patch) | |
tree | ce7e884e8239d25646ec1a9d30e4844829eba554 /socket.c | |
parent | 6b70292d33eae6df4882704ebc406953b5c1b38f (diff) | |
download | fetchmail-7b6543d77dae0d9dc8cf8f4b46a08698da28876e.tar.gz fetchmail-7b6543d77dae0d9dc8cf8f4b46a08698da28876e.tar.bz2 fetchmail-7b6543d77dae0d9dc8cf8f4b46a08698da28876e.zip |
socket.c: Make SockKeepalive static, and readability variable renames.
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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); } } |