static void htcpIncomingConnectionOpened(const Comm::ConnectionPointer &conn, int errNo);
static uint32_t msg_id_counter = 0;
-static Comm::ConnectionPointer htcpOutgoingConn = NULL;
-static Comm::ConnectionPointer htcpIncomingConn = NULL;
+static Comm::ConnectionPointer htcpOutgoingConn = nullptr;
+static Comm::ConnectionPointer htcpIncomingConn = nullptr;
#define N_QUERIED_KEYS 8192
static uint32_t queried_id[N_QUERIED_KEYS];
static cache_key queried_keys[N_QUERIED_KEYS][SQUID_MD5_DIGEST_LENGTH];
if (l > sz) {
debugs(31, 3, "htcpUnpackDetail: failed to unpack RESP_HDRS");
delete d;
- return NULL;
+ return nullptr;
}
/* Set RESP-HDRS */
if (l > sz) {
debugs(31, 3, "htcpUnpackDetail: failed to unpack ENTITY_HDRS");
delete d;
- return NULL;
+ return nullptr;
}
/* Add terminating null to RESP-HDRS */
if (l > sz) {
debugs(31, 3, "htcpUnpackDetail: failed to unpack CACHE_HDRS");
delete d;
- return NULL;
+ return nullptr;
}
/* Add terminating null to ENTITY-HDRS */
htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, Ip::Address &from)
{
HtcpReplyData htcpReply;
- cache_key *key = NULL;
+ cache_key *key = nullptr;
Ip::Address *peer;
- htcpDetail *d = NULL;
+ htcpDetail *d = nullptr;
char *t;
if (queried_id[hdr->msg_id % N_QUERIED_KEYS] != hdr->msg_id) {
debugs(31, 3, "htcpHandleTstResponse: HIT");
d = htcpUnpackDetail(buf, sz);
- if (d == NULL) {
+ if (d == nullptr) {
debugs(31, 3, "htcpHandleTstResponse: bad DETAIL");
return;
}
htcpTstReply(dhdr, e, this, from); /* hit */
htcpLogHtcp(from, dhdr->opcode, LOG_UDP_HIT, uri, al);
} else {
- htcpTstReply(dhdr, NULL, NULL, from); /* cache miss */
+ htcpTstReply(dhdr, nullptr, nullptr, from); /* cache miss */
htcpLogHtcp(from, dhdr->opcode, LOG_UDP_MISS, uri, al);
}
}
htcpHandleMsg(buf, len, from);
- Comm::SetSelect(fd, COMM_SELECT_READ, htcpRecv, NULL, 0);
+ Comm::SetSelect(fd, COMM_SELECT_READ, htcpRecv, nullptr, 0);
}
/*
if (!Comm::IsConnOpen(htcpOutgoingConn))
fatal("Cannot open Outgoing HTCP Socket");
- Comm::SetSelect(htcpOutgoingConn->fd, COMM_SELECT_READ, htcpRecv, NULL, 0);
+ Comm::SetSelect(htcpOutgoingConn->fd, COMM_SELECT_READ, htcpRecv, nullptr, 0);
debugs(31, DBG_IMPORTANT, "Sending HTCP messages from " << htcpOutgoingConn->local);
}
if (!Comm::IsConnOpen(conn))
fatal("Cannot open HTCP Socket");
- Comm::SetSelect(conn->fd, COMM_SELECT_READ, htcpRecv, NULL, 0);
+ Comm::SetSelect(conn->fd, COMM_SELECT_READ, htcpRecv, nullptr, 0);
debugs(31, DBG_CRITICAL, "Accepting HTCP messages on " << conn->local);
stuff.S.method = sb.c_str();
stuff.S.uri = (char *) e->url();
stuff.S.version = vbuf;
- HttpStateData::httpBuildRequestHeader(req, e, NULL, &hdr, flags);
+ HttpStateData::httpBuildRequestHeader(req, e, nullptr, &hdr, flags);
MemBuf mb;
mb.init();
hdr.packInto(&mb);
stuff.S.uri = uri.c_str();
stuff.S.version = vbuf;
if (reason != HTCP_CLR_INVALIDATION) {
- HttpStateData::httpBuildRequestHeader(req, e, NULL, &hdr, flags);
+ HttpStateData::httpBuildRequestHeader(req, e, nullptr, &hdr, flags);
mb.init();
hdr.packInto(&mb);
hdr.clean();
stuff.S.req_hdrs = mb.buf;
} else {
- stuff.S.req_hdrs = NULL;
+ stuff.S.req_hdrs = nullptr;
}
pktlen = htcpBuildPacket(pkt, sizeof(pkt), &stuff);
if (reason != HTCP_CLR_INVALIDATION) {
* function from executing repeatedly. When we are really ready to
* exit or restart, main will comm_close the 'out' descriptor.
*/
- htcpIncomingConn = NULL;
+ htcpIncomingConn = nullptr;
/*
* Normally we only write to the outgoing HTCP socket, but
*/
assert(Comm::IsConnOpen(htcpOutgoingConn));
- Comm::SetSelect(htcpOutgoingConn->fd, COMM_SELECT_READ, NULL, NULL, 0);
+ Comm::SetSelect(htcpOutgoingConn->fd, COMM_SELECT_READ, nullptr, nullptr, 0);
}
void
{
htcpSocketShutdown();
- if (htcpOutgoingConn != NULL) {
+ if (htcpOutgoingConn != nullptr) {
debugs(12, DBG_IMPORTANT, "Stop sending HTCP from " << htcpOutgoingConn->local);
- htcpOutgoingConn = NULL;
+ htcpOutgoingConn = nullptr;
}
}
assert(logcode != LOG_TAG_NONE);
al->cache.code.update(logcode);
- accessLogLog(al, NULL);
+ accessLogLog(al, nullptr);
}