/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * 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.
#include "comm/Loops.h"
#include "defines.h"
#include "fd.h"
+#include "icmp/IcmpConfig.h"
#include "icmp/IcmpSquid.h"
#include "icmp/net_db.h"
#include "ip/tools.h"
x = comm_udp_send(icmp_sock, (char *)&pecho, slen, 0);
if (x < 0) {
- debugs(37, DBG_IMPORTANT, HERE << "send: " << xstrerror());
+ int xerrno = errno;
+ debugs(37, DBG_IMPORTANT, MYNAME << "send: " << xstrerr(xerrno));
/** \li If the send results in ECONNREFUSED or EPIPE errors from helper, will cleanly shutdown the module. */
/** \todo This should try restarting the helper a few times?? before giving up? */
- if (errno == ECONNREFUSED || errno == EPIPE) {
+ if (xerrno == ECONNREFUSED || xerrno == EPIPE) {
Close();
return;
}
0);
if (n < 0 && EAGAIN != errno) {
- debugs(37, DBG_IMPORTANT, HERE << "recv: " << xstrerror());
+ int xerrno = errno;
+ debugs(37, DBG_IMPORTANT, MYNAME << "recv: " << xstrerr(xerrno));
- if (errno == ECONNREFUSED)
+ if (xerrno == ECONNREFUSED)
Close();
- if (errno == ECONNRESET)
+ if (xerrno == ECONNRESET)
Close();
if (++fail_count == 10)
Ip::Address localhost;
/* User configured disabled. */
- if (!Config.pinger.enable) {
+ if (!IcmpCfg.enable) {
Close();
return -1;
}
* least on FreeBSD).
*/
pid = ipcCreate(IPC_UDP_SOCKET,
- Config.pinger.program,
+ IcmpCfg.program.c_str(),
args,
"Pinger Socket",
localhost,