#include "icmp/IcmpSquid.h"
#include "icmp/net_db.h"
#include "ip/tools.h"
+#include "protos.h"
#include "SquidTime.h"
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
// Instance global to be available in main() and elsewhere.
IcmpSquid icmpEngine;
#endif /* USE_ICMP */
-
IcmpSquid::IcmpSquid() : Icmp()
{
; // nothing new.
Close();
}
-
#if USE_ICMP
void
x = comm_udp_send(icmp_sock, (char *)&pecho, slen, 0);
if (x < 0) {
- debugs(37, 1, HERE << "send: " << xstrerror());
+ debugs(37, DBG_IMPORTANT, HERE << "send: " << xstrerror());
/** \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? */
}
/** All other send errors are ignored. */
} else if (x != slen) {
- debugs(37, 1, HERE << "Wrote " << x << " of " << slen << " bytes");
+ debugs(37, DBG_IMPORTANT, HERE << "Wrote " << x << " of " << slen << " bytes");
}
}
0);
if (n < 0 && EAGAIN != errno) {
- debugs(37, 1, HERE << "recv: " << xstrerror());
+ debugs(37, DBG_IMPORTANT, HERE << "recv: " << xstrerror());
if (errno == ECONNREFUSED)
Close();
break;
default:
- debugs(37, 1, HERE << "Bad opcode: " << preply.opcode << " from " << F);
+ debugs(37, DBG_IMPORTANT, HERE << "Bad opcode: " << preply.opcode << " from " << F);
break;
}
}
commUnsetFdTimeout(icmp_sock);
- debugs(37, 1, HERE << "Pinger socket opened on FD " << icmp_sock);
+ debugs(37, DBG_IMPORTANT, HERE << "Pinger socket opened on FD " << icmp_sock);
/* Tests the pinger immediately using localhost */
if (Ip::EnableIpv6)
if (icmp_sock < 0)
return;
- debugs(37, 1, HERE << "Closing Pinger socket on FD " << icmp_sock);
+ debugs(37, DBG_IMPORTANT, HERE << "Closing Pinger socket on FD " << icmp_sock);
#if _SQUID_MSWIN_
if (hIpc) {
if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) {
getCurrentTime();
- debugs(37, 0, HERE << "WARNING: (pinger," << pid << ") didn't exit in 12 seconds");
+ debugs(37, DBG_CRITICAL, HERE << "WARNING: (pinger," << pid << ") didn't exit in 12 seconds");
}
CloseHandle(hIpc);