debugs(11,5, "HttpStateData " << this << " created");
serverConnection = fwd->serverConnection();
- if (fwd->serverConnection() != NULL)
+ if (fwd->serverConnection() != nullptr)
_peer = cbdataReference(fwd->serverConnection()->getPeer()); /* might be NULL */
flags.peering = _peer;
StoreEntry *pe = findPreviouslyCachedEntry(e);
- if (pe != NULL) {
+ if (pe != nullptr) {
assert(e != pe);
#if USE_HTCP
neighborsHtcpClear(e, e->mem_obj->request.getRaw(), e->mem_obj->method, HTCP_CLR_INVALIDATION);
else
pe = storeGetPublic(e->mem_obj->storeId(), Http::METHOD_HEAD);
- if (pe != NULL) {
+ if (pe != nullptr) {
assert(e != pe);
#if USE_HTCP
neighborsHtcpClear(e, e->mem_obj->request.getRaw(), HttpRequestMethod(Http::METHOD_HEAD), HTCP_CLR_INVALIDATION);
const char *v;
#if USE_HTTP_VIOLATIONS
- const RefreshPattern *R = NULL;
+ const RefreshPattern *R = nullptr;
/* This strange looking define first looks up the refresh pattern
* and then checks if the specified flag is set. The main purpose
/* Attempt to parse the first line; this will define where the protocol, status, reason-phrase and header begin */
{
- if (hp == NULL)
+ if (hp == nullptr)
hp = new Http1::ResponseParser;
bool parsedOk = hp->parse(inBuf);
}
// done with Parser, now process using the HttpReply
- hp = NULL;
+ hp = nullptr;
newrep->sources |= request->url.getScheme() == AnyP::PROTO_HTTPS ? Http::Message::srcHttps : Http::Message::srcHttp;
flags.do_next_read = false;
comm_remove_close_handler(serverConnection->fd, closeHandler);
- closeHandler = NULL;
+ closeHandler = nullptr;
Ip::Address client_addr; // XXX: Remove as unused. Why was it added?
if (request->flags.spoofClientIp)
if (Comm::IsConnOpen(serverConnection)) {
fwd->unregister(serverConnection);
comm_remove_close_handler(serverConnection->fd, closeHandler);
- closeHandler = NULL;
+ closeHandler = nullptr;
serverConnection->close();
}
}
if (request->extacl_user.size())
username = request->extacl_user.termedBuf();
#if USE_AUTH
- else if (request->auth_user_request != NULL)
+ else if (request->auth_user_request != nullptr)
username = request->auth_user_request->username();
#endif
/* Kerberos login to peer */
#if HAVE_AUTH_MODULE_NEGOTIATE && HAVE_KRB5 && HAVE_GSSAPI
if (strncmp(request->peer_login, "NEGOTIATE",strlen("NEGOTIATE")) == 0) {
- char *Token=NULL;
- char *PrincipalName=NULL,*p;
+ char *Token=nullptr;
+ char *PrincipalName=nullptr,*p;
int negotiate_flags = 0;
- if ((p=strchr(request->peer_login,':')) != NULL ) {
+ if ((p=strchr(request->peer_login,':')) != nullptr ) {
PrincipalName=++p;
}
if (request->flags.auth_no_keytab) {
LOCAL_ARRAY(char, bbuf, BBUF_SZ);
LOCAL_ARRAY(char, ntoabuf, MAX_IPSTRLEN);
const HttpHeader *hdr_in = &request->header;
- const HttpHeaderEntry *e = NULL;
+ const HttpHeaderEntry *e = nullptr;
HttpHeaderPos pos = HttpHeaderInitPos;
assert (hdr_out->owner == hoRequest);
int64_t roffLimit = request->getRangeOffsetLimit();
- if (NULL == request->range || !request->flags.cachable
+ if (nullptr == request->range || !request->flags.cachable
|| request->range->offsetLimitExceeded(roffLimit) || request->flags.connectionAuth)
result = false;
if (!Comm::IsConnOpen(serverConnection)) {
debugs(11,3, "cannot send request to closing " << serverConnection);
- assert(closeHandler != NULL);
+ assert(closeHandler != nullptr);
return false;
}
flags.do_next_read = true;
maybeReadVirginBody();
- if (request->body_pipe != NULL) {
+ if (request->body_pipe != nullptr) {
if (!startRequestBodyFlow()) // register to receive body data
return false;
typedef CommCbMemFunT<HttpStateData, CommIoCbParams> Dialer;
else if (flags.tunneling)
// tunneled non pinned bumped requests must not keepalive
flags.keepalive = !request->flags.sslBumped;
- else if (_peer == NULL)
+ else if (_peer == nullptr)
flags.keepalive = true;
else if (_peer->stats.n_keepalives_sent < 10)
flags.keepalive = true;
}
mb.init();
- request->peer_host=_peer?_peer->host:NULL;
+ request->peer_host=_peer?_peer->host:nullptr;
buildRequestPrefix(&mb);
debugs(11, 2, "HTTP Server " << serverConnection);
MemBuf raw;
- Must(requestBodySource != NULL);
+ Must(requestBodySource != nullptr);
if (!requestBodySource->getMoreData(raw))
return false; // no request body bytes to chunk yet
if (!Comm::IsConnOpen(serverConnection)) {
debugs(11, 3, "ignoring broken POST for closed " << serverConnection);
- assert(closeHandler != NULL);
+ assert(closeHandler != nullptr);
return true; // prevent caller from proceeding as if nothing happened
}
typedef CommCbMemFunT<HttpStateData, CommIoCbParams> Dialer;
requestSender = JobCallback(11,5,
Dialer, this, HttpStateData::wroteLast);
- Comm::Write(serverConnection, "\r\n", 2, requestSender, NULL);
+ Comm::Write(serverConnection, "\r\n", 2, requestSender, nullptr);
return true;
#else
return false;
typedef CommCbMemFunT<HttpStateData, CommIoCbParams> Dialer;
requestSender = JobCallback(11,5, Dialer, this, HttpStateData::wroteLast);
- Comm::Write(serverConnection, "0\r\n\r\n", 5, requestSender, NULL);
+ Comm::Write(serverConnection, "0\r\n\r\n", 5, requestSender, nullptr);
return true;
}
return;
}
- assert(requestBodySource != NULL);
+ assert(requestBodySource != nullptr);
if (requestBodySource->buf().hasContent()) {
// XXX: why does not this trigger a debug message on every request?