]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/AccessLogEntry.cc
2 #include "AccessLogEntry.h"
4 #include "HttpRequest.h"
5 #include "SquidConfig.h"
8 #include "ssl/support.h"
10 AccessLogEntry::SslDetails::SslDetails(): user(NULL
), bumpMode(::Ssl::bumpEnd
)
16 AccessLogEntry::getLogClientIp(char *buf
, size_t bufsz
) const
18 #if FOLLOW_X_FORWARDED_FOR
19 if (Config
.onoff
.log_uses_indirect_client
&& request
)
20 request
->indirect_client_addr
.toStr(buf
, bufsz
);
23 if (tcpClient
!= NULL
)
24 tcpClient
->remote
.toStr(buf
, bufsz
);
25 else if (cache
.caddr
.isNoAddr()) // e.g., ICAP OPTIONS lack client
26 strncpy(buf
, "-", bufsz
);
28 cache
.caddr
.toStr(buf
, bufsz
);
31 AccessLogEntry::~AccessLogEntry()
33 safe_free(headers
.request
);
36 safe_free(adapt
.last_meta
);
39 safe_free(headers
.reply
);
41 safe_free(headers
.adapted_request
);
42 HTTPMSGUNLOCK(adapted_request
);
45 HTTPMSGUNLOCK(request
);
47 HTTPMSGUNLOCK(icap
.reply
);
48 HTTPMSGUNLOCK(icap
.request
);
50 cbdataReferenceDone(cache
.port
);