/*
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
CBDATA_NAMESPACED_CLASS_INIT(Comm, ConnOpener);
-Comm::ConnOpener::ConnOpener(Comm::ConnectionPointer &c, AsyncCall::Pointer &handler, time_t ctimeout) :
+Comm::ConnOpener::ConnOpener(const Comm::ConnectionPointer &c, const AsyncCall::Pointer &handler, time_t ctimeout) :
AsyncJob("Comm::ConnOpener"),
host_(NULL),
temporaryFd_(-1),
totalTries_(0),
failRetries_(0),
deadline_(squid_curtime + static_cast<time_t>(ctimeout))
-{}
+{
+ debugs(5, 3, "will connect to " << c << " with " << ctimeout << " timeout");
+}
Comm::ConnOpener::~ConnOpener()
{
{
Must(temporaryFd_ < 0);
- // our initators signal abort by cancelling their callbacks
+ // our initiators signal abort by cancelling their callbacks
if (callback_ == NULL || callback_->canceled())
return false;
Ip::Address::InitAddr(addr);
if (getsockname(conn_->fd, addr->ai_addr, &(addr->ai_addrlen)) != 0) {
- debugs(50, DBG_IMPORTANT, "ERROR: Failed to retrieve TCP/UDP details for socket: " << conn_ << ": " << xstrerror());
+ int xerrno = errno;
+ debugs(50, DBG_IMPORTANT, "ERROR: Failed to retrieve TCP/UDP details for socket: " << conn_ << ": " << xstrerr(xerrno));
Ip::Address::FreeAddr(addr);
return;
}