HTTPMSGUNLOCK(icap.reply);
HTTPMSGUNLOCK(icap.request);
#endif
- cbdataReferenceDone(cache.port);
}
const char *ssluser;
Ssl::X509_Pointer sslClientCert; ///< cert received from the client
#endif
- AnyP::PortCfg *port;
+ AnyP::PortCfgPointer port;
} cache;
#include "squid.h"
+#include "anyp/PortCfg.h"
#include "comm/Connection.h"
#include "CommCalls.h"
#include "fde.h"
tests/stub_HelperChildConfig.cc \
tests/stub_libformat.cc \
tests/stub_libauth.cc \
+ tests/stub_libcomm.cc \
StatCounters.h \
StatCounters.cc \
StatHist.h \
acl/libstate.la \
libsquid.la \
comm/libcomm.la \
- anyp/libanyp.la \
ip/libip.la \
fs/libfs.la \
ipc/libipc.la \
$(DISK_LIBS) \
$(DISK_OS_LIBS) \
acl/libapi.la \
+ anyp/libanyp.la \
mgr/libmgr.la \
$(SSL_LIBS) \
ipc/libipc.la \
http/libsquid-http.la \
libsquid.la \
comm/libcomm.la \
- anyp/libanyp.la \
ip/libip.la \
fs/libfs.la \
$(COMMON_LIBS) \
acl/libacls.la \
acl/libapi.la \
acl/libstate.la \
+ anyp/libanyp.la \
eui/libeui.la \
$(SSL_LIBS) \
ipc/libipc.la \
#define SQUID_SRC_MASTERXACTION_H
#include "anyp/forward.h"
-#include "base/CbcPointer.h"
#include "base/InstanceId.h"
#include "base/Lock.h"
#include "comm/forward.h"
#endif
} Port;
- struct {
- AnyP::PortCfg *http;
-#if USE_OPENSSL
- AnyP::PortCfg *https;
-#endif
- } Sockaddr;
#if SQUID_SNMP
struct {
// Is this ACL going to work?
if (strcmp(theType, "myip") == 0) {
- AnyP::PortCfg *p = Config.Sockaddr.http;
- while (p) {
+ AnyP::PortCfgPointer p = HttpPortList;
+ while (p != NULL) {
// Bug 3239: not reliable when there is interception traffic coming
if (p->flags.natIntercept)
debugs(28, DBG_CRITICAL, "WARNING: 'myip' ACL is not reliable for interception proxies. Please use 'myportname' instead.");
debugs(28, DBG_IMPORTANT, "UPGRADE: ACL 'myip' type is has been renamed to 'localip' and matches the IP the client connected to.");
theType = "localip";
} else if (strcmp(theType, "myport") == 0) {
- AnyP::PortCfg *p = Config.Sockaddr.http;
- while (p) {
+ AnyP::PortCfgPointer p = HttpPortList;
+ while (p != NULL) {
// Bug 3239: not reliable when there is interception traffic coming
// Bug 3239: myport - not reliable (yet) when there is interception traffic coming
if (p->flags.natIntercept)
#include <cstring>
#include <limits>
-CBDATA_NAMESPACED_CLASS_INIT(AnyP, PortCfg);
+AnyP::PortCfgPointer HttpPortList;
+#if USE_OPENSSL
+AnyP::PortCfgPointer HttpsPortList;
+#endif
int NHttpSockets = 0;
int HttpSockets[MAXTCPLISTENPORTS];
AnyP::PortCfg::PortCfg() :
- next(NULL),
+ next(),
s(),
transport(AnyP::PROTO_HTTP,1,1), // "Squid is an HTTP proxy", etc.
name(NULL),
#endif
}
-AnyP::PortCfg *
+AnyP::PortCfgPointer
AnyP::PortCfg::clone() const
{
- AnyP::PortCfg *b = new AnyP::PortCfg();
+ AnyP::PortCfgPointer b = new AnyP::PortCfg();
b->s = s;
if (name)
b->name = xstrdup(name);
namespace AnyP
{
-class PortCfg
+class PortCfg : public RefCountable
{
public:
PortCfg();
~PortCfg();
- AnyP::PortCfg *clone() const;
+ AnyP::PortCfgPointer clone() const;
#if USE_OPENSSL
/// creates, configures, and validates SSL context and related port options
void configureSslServerContext();
*/
void setTransport(const char *aProtocol);
- PortCfg *next;
+ PortCfgPointer next;
Ip::Address s;
AnyP::ProtocolVersion transport; ///< transport protocol and version received by this port
long sslContextFlags; ///< flags modifying the use of SSL
long sslOptions; ///< SSL engine options
#endif
-
- CBDATA_CLASS2(PortCfg); // namespaced
};
} // namespace AnyP
+/// list of Squid http_port configured
+extern AnyP::PortCfgPointer HttpPortList;
+
+#if USE_OPENSSL
+/// list of Squid https_port configured
+extern AnyP::PortCfgPointer HttpsPortList;
+#endif
+
// Max number of TCP listening ports
#define MAXTCPLISTENPORTS 128
#ifndef _SQUID_SRC_ANYP_FORWARD_H
#define _SQUID_SRC_ANYP_FORWARD_H
-#include "base/CbcPointer.h"
+#include "base/RefCount.h"
namespace AnyP
{
class PortCfg;
-typedef CbcPointer<PortCfg> PortCfgPointer;
+typedef RefCount<PortCfg> PortCfgPointer;
class UriScheme;
#endif /* CURRENTLY_UNUSED */
#endif /* USE_WCCPv2 */
-static void parsePortCfg(AnyP::PortCfg **, const char *protocol);
+static void parsePortCfg(AnyP::PortCfgPointer *, const char *protocol);
#define parse_PortCfg(l) parsePortCfg((l), token)
-static void dump_PortCfg(StoreEntry *, const char *, const AnyP::PortCfg *);
-static void free_PortCfg(AnyP::PortCfg **);
+static void dump_PortCfg(StoreEntry *, const char *, const AnyP::PortCfgPointer &);
+#define free_PortCfg(h) *(h)=NULL
#if USE_OPENSSL
static void parse_sslproxy_cert_sign(sslproxy_cert_sign **cert_sign);
}
}
- for (AnyP::PortCfg *s = Config.Sockaddr.http; s != NULL; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (!s->flags.tunnelSslBumping)
continue;
s->configureSslServerContext();
}
- for (AnyP::PortCfg *s = Config.Sockaddr.https; s != NULL; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpsPortList; s != NULL; s = s->next) {
debugs(3, DBG_IMPORTANT, "Initializing https_port " << s->s << " SSL context");
s->configureSslServerContext();
}
#endif /* USE_WCCPv2 */
static void
-parsePortSpecification(AnyP::PortCfg * s, char *token)
+parsePortSpecification(const AnyP::PortCfgPointer &s, char *token)
{
char *host = NULL;
unsigned short port = 0;
}
static void
-parse_port_option(AnyP::PortCfg * s, char *token)
+parse_port_option(AnyP::PortCfgPointer &s, char *token)
{
/* modes first */
void
add_http_port(char *portspec)
{
- AnyP::PortCfg *s = new AnyP::PortCfg();
+ AnyP::PortCfgPointer s = new AnyP::PortCfg();
s->setTransport("HTTP");
parsePortSpecification(s, portspec);
// we may need to merge better if the above returns a list with clones
assert(s->next == NULL);
- s->next = cbdataReference(Config.Sockaddr.http);
- cbdataReferenceDone(Config.Sockaddr.http);
- Config.Sockaddr.http = cbdataReference(s);
+ s->next = HttpPortList;
+ HttpPortList = s;
}
static void
-parsePortCfg(AnyP::PortCfg ** head, const char *optionName)
+parsePortCfg(AnyP::PortCfgPointer *head, const char *optionName)
{
const char *protocol = NULL;
if (strcmp(optionName, "http_port") == 0 ||
return;
}
- AnyP::PortCfg *s = new AnyP::PortCfg();
+ AnyP::PortCfgPointer s = new AnyP::PortCfg();
s->setTransport(protocol);
parsePortSpecification(s, token);
if (Ip::EnableIpv6&IPV6_SPECIAL_SPLITSTACK && s->s.isAnyAddr()) {
// clone the port options from *s to *(s->next)
- s->next = cbdataReference(s->clone());
+ s->next = s->clone();
s->next->s.setIPv4();
debugs(3, 3, AnyP::UriScheme(s->transport.protocol).c_str() << "_port: clone wildcard address for split-stack: " << s->s << " and " << s->next->s);
}
- while (*head)
- head = &(*head)->next;
+ while (*head != NULL)
+ head = &((*head)->next);
- *head = cbdataReference(s);
+ *head = s;
}
static void
-dump_generic_port(StoreEntry * e, const char *n, const AnyP::PortCfg * s)
+dump_generic_port(StoreEntry * e, const char *n, const AnyP::PortCfgPointer &s)
{
char buf[MAX_IPSTRLEN];
}
static void
-dump_PortCfg(StoreEntry * e, const char *n, const AnyP::PortCfg * s)
+dump_PortCfg(StoreEntry * e, const char *n, const AnyP::PortCfgPointer &s)
{
- while (s) {
- dump_generic_port(e, n, s);
+ for (AnyP::PortCfgPointer p = s; p != NULL; p = p->next) {
+ dump_generic_port(e, n, p);
storeAppendPrintf(e, "\n");
- s = s->next;
- }
-}
-
-static void
-free_PortCfg(AnyP::PortCfg ** head)
-{
- AnyP::PortCfg *s;
-
- while ((s = *head) != NULL) {
- *head = s->next;
- cbdataReferenceDone(s);
}
}
NAME: http_port ascii_port
TYPE: PortCfg
DEFAULT: none
-LOC: Config.Sockaddr.http
+LOC: HttpPortList
DOC_START
Usage: port [mode] [options]
hostname:port [mode] [options]
IFDEF: USE_OPENSSL
TYPE: PortCfg
DEFAULT: none
-LOC: Config.Sockaddr.https
+LOC: HttpsPortList
DOC_START
Usage: [ip:]port cert=certificate.pem [key=key.pem] [mode] [options...]
class ListeningStartedDialer: public CallDialer, public Ipc::StartListeningCb
{
public:
- typedef void (*Handler)(AnyP::PortCfg *portCfg, const Ipc::FdNoteId note, const Subscription::Pointer &sub);
- ListeningStartedDialer(Handler aHandler, AnyP::PortCfg *aPortCfg, const Ipc::FdNoteId note, const Subscription::Pointer &aSub):
+ typedef void (*Handler)(AnyP::PortCfgPointer &portCfg, const Ipc::FdNoteId note, const Subscription::Pointer &sub);
+ ListeningStartedDialer(Handler aHandler, AnyP::PortCfgPointer &aPortCfg, const Ipc::FdNoteId note, const Subscription::Pointer &aSub):
handler(aHandler), portCfg(aPortCfg), portTypeNote(note), sub(aSub) {}
virtual void print(std::ostream &os) const {
startPrint(os) <<
- ", " << FdNote(portTypeNote) << " port=" << (void*)portCfg << ')';
+ ", " << FdNote(portTypeNote) << " port=" << (void*)&portCfg << ')';
}
virtual bool canDial(AsyncCall &) const { return true; }
Handler handler;
private:
- AnyP::PortCfg *portCfg; ///< from Config.Sockaddr.http
+ AnyP::PortCfgPointer portCfg; ///< from HttpPortList
Ipc::FdNoteId portTypeNote; ///< Type of IPC socket being opened
Subscription::Pointer sub; ///< The handler to be subscribed for this connetion listener
};
-static void clientListenerConnectionOpened(AnyP::PortCfg *s, const Ipc::FdNoteId portTypeNote, const Subscription::Pointer &sub);
+static void clientListenerConnectionOpened(AnyP::PortCfgPointer &s, const Ipc::FdNoteId portTypeNote, const Subscription::Pointer &sub);
/* our socket-related context */
if (!flags.swanSang)
debugs(33, DBG_IMPORTANT, "BUG: ConnStateData was not destroyed properly; " << clientConnection);
- cbdataReferenceDone(port);
-
if (bodyPipe != NULL)
stopProducingFor(bodyPipe, false);
*method_p = HttpRequestMethod(&hp->buf[hp->req.m_start], &hp->buf[hp->req.m_end]+1);
/* deny CONNECT via accelerated ports */
- if (*method_p == Http::METHOD_CONNECT && csd->port && csd->port->flags.accelSurrogate) {
+ if (*method_p == Http::METHOD_CONNECT && csd->port != NULL && csd->port->flags.accelSurrogate) {
debugs(33, DBG_IMPORTANT, "WARNING: CONNECT method received on " << csd->port->transport.protocol << " Accelerator port " << csd->port->s.port());
/* XXX need a way to say "this many character length string" */
debugs(33, DBG_IMPORTANT, "WARNING: for request: " << hp->buf);
// store the details required for creating more MasterXaction objects as new requests come in
clientConnection = xact->tcpClient;
- port = cbdataReference(xact->squidPort.get());
+ port = xact->squidPort;
log_addr = xact->tcpClient->remote;
log_addr.applyMask(Config.Addrs.client_netmask);
MasterXaction::Pointer xact = params.xaction;
AnyP::PortCfgPointer s = xact->squidPort;
- if (!s.valid()) {
+ if (!s) {
// it is possible the call or accept() was still queued when the port was reconfigured
debugs(33, 2, "HTTP accept failure: port reconfigured.");
return;
static void
clientHttpConnectionsOpen(void)
{
- AnyP::PortCfg *s = NULL;
-
- for (s = Config.Sockaddr.http; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (MAXTCPLISTENPORTS == NHttpSockets) {
debugs(1, DBG_IMPORTANT, "WARNING: You have too many 'http_port' lines.");
debugs(1, DBG_IMPORTANT, " The limit is " << MAXTCPLISTENPORTS << " HTTP ports.");
// setup the subscriptions such that new connections accepted by listenConn are handled by HTTP
typedef CommCbFunPtrCallT<CommAcceptCbPtrFun> AcceptCall;
- RefCount<AcceptCall> subCall = commCbCall(5, 5, "httpAccept", CommAcceptCbPtrFun(httpAccept, s));
+ RefCount<AcceptCall> subCall = commCbCall(5, 5, "httpAccept", CommAcceptCbPtrFun(httpAccept, CommAcceptCbParams(NULL)));
Subscription::Pointer sub = new CallSubscription<AcceptCall>(subCall);
AsyncCall::Pointer listenCall = asyncCall(33,2, "clientListenerConnectionOpened",
static void
clientHttpsConnectionsOpen(void)
{
- AnyP::PortCfg *s;
-
- for (s = Config.Sockaddr.https; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpsPortList; s != NULL; s = s->next) {
if (MAXTCPLISTENPORTS == NHttpSockets) {
debugs(1, DBG_IMPORTANT, "Ignoring 'https_port' lines exceeding the limit.");
debugs(1, DBG_IMPORTANT, "The limit is " << MAXTCPLISTENPORTS << " HTTPS ports.");
// setup the subscriptions such that new connections accepted by listenConn are handled by HTTPS
typedef CommCbFunPtrCallT<CommAcceptCbPtrFun> AcceptCall;
- RefCount<AcceptCall> subCall = commCbCall(5, 5, "httpsAccept", CommAcceptCbPtrFun(httpsAccept, s));
+ RefCount<AcceptCall> subCall = commCbCall(5, 5, "httpsAccept", CommAcceptCbPtrFun(httpsAccept, CommAcceptCbParams(NULL)));
Subscription::Pointer sub = new CallSubscription<AcceptCall>(subCall);
AsyncCall::Pointer listenCall = asyncCall(33, 2, "clientListenerConnectionOpened",
/// process clientHttpConnectionsOpen result
static void
-clientListenerConnectionOpened(AnyP::PortCfg *s, const Ipc::FdNoteId portTypeNote, const Subscription::Pointer &sub)
+clientListenerConnectionOpened(AnyP::PortCfgPointer &s, const Ipc::FdNoteId portTypeNote, const Subscription::Pointer &sub)
{
+ Must(s != NULL);
+
if (!OpenedHttpSocket(s->listenConn, portTypeNote))
return;
- Must(s);
Must(Comm::IsConnOpen(s->listenConn));
// TCP: setup a job to handle accept() with subscribed handler
- AsyncJob::Start(new Comm::TcpAcceptor(s->listenConn, FdNote(portTypeNote), sub));
+ AsyncJob::Start(new Comm::TcpAcceptor(s, FdNote(portTypeNote), sub));
debugs(1, DBG_IMPORTANT, "Accepting " <<
(s->flags.natIntercept ? "NAT intercepted " : "") <<
void
clientHttpConnectionsClose(void)
{
- for (AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (s->listenConn != NULL) {
debugs(1, DBG_IMPORTANT, "Closing HTTP port " << s->listenConn->local);
s->listenConn->close();
}
#if USE_OPENSSL
- for (AnyP::PortCfg *s = Config.Sockaddr.https; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpsPortList; s != NULL; s = s->next) {
if (s->listenConn != NULL) {
debugs(1, DBG_IMPORTANT, "Closing HTTPS port " << s->listenConn->local);
s->listenConn->close();
} pinning;
/// Squid listening port details where this connection arrived.
- AnyP::PortCfg *port;
+ AnyP::PortCfgPointer port;
bool transparent() const;
bool reading() const;
al = new AccessLogEntry;
al->cache.start_time = current_time;
al->tcpClient = clientConnection = aConn->clientConnection;
- al->cache.port = cbdataReference(aConn->port);
+ al->cache.port = aConn->port;
al->cache.caddr = aConn->log_addr;
#if USE_OPENSSL
static int
fdIsTcpListen(int fd)
{
- for (const AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (const AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (s->listenConn != NULL && s->listenConn->fd == fd)
return 1;
}
static int
fdIsTcpListener(int fd)
{
- for (const AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (const AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (s->listenConn != NULL && s->listenConn->fd == fd)
return 1;
}
// XXX: only poll sockets that won't be deferred. But how do we identify them?
- for (const AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (const AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (Comm::IsConnOpen(s->listenConn)) {
fds[nfds] = s->listenConn->fd;
++nfds;
static int
fdIsTcpListener(int fd)
{
- for (const AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (const AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (s->listenConn != NULL && s->listenConn->fd == fd)
return 1;
}
// XXX: only poll sockets that won't be deferred. But how do we identify them?
- for (const AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (const AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (Comm::IsConnOpen(s->listenConn)) {
fds[nfds] = s->listenConn->fd;
++nfds;
errcode(0),
isLimited(0),
theCallSub(aSub),
- conn(newConn)
+ conn(newConn),
+ listenPort_()
+{}
+
+Comm::TcpAcceptor::TcpAcceptor(const AnyP::PortCfgPointer &p, const char *note, const Subscription::Pointer &aSub) :
+ AsyncJob("Comm::TcpAcceptor"),
+ errcode(0),
+ isLimited(0),
+ theCallSub(aSub),
+ conn(p->listenConn),
+ listenPort_(p)
{}
void
AsyncCall::Pointer call = theCallSub->callback();
CommAcceptCbParams ¶ms = GetCommParams<CommAcceptCbParams>(call);
params.xaction = new MasterXaction;
- params.xaction->squidPort = static_cast<AnyP::PortCfg*>(params.data);
+ params.xaction->squidPort = listenPort_;
params.fd = conn->fd;
params.conn = params.xaction->tcpClient = newConnDetails;
params.flag = flag;
#ifndef SQUID_COMM_TCPACCEPTOR_H
#define SQUID_COMM_TCPACCEPTOR_H
+#include "anyp/forward.h"
#include "base/AsyncJob.h"
#include "base/CbcPointer.h"
#include "base/Subscription.h"
public:
TcpAcceptor(const Comm::ConnectionPointer &conn, const char *note, const Subscription::Pointer &aSub);
+ TcpAcceptor(const AnyP::PortCfgPointer &listenPort, const char *note, const Subscription::Pointer &aSub);
/** Subscribe a handler to receive calls back about new connections.
* Unsubscribes any existing subscribed handler.
/// Reserved for read-only use.
ConnectionPointer conn;
+ /// configuration details of the listening port (if provided)
+ AnyP::PortCfgPointer listenPort_;
+
/// listen socket closure handler
AsyncCall::Pointer closer_;
// avoid logging a dash if we have reliable info
const bool interceptedAtKnownPort = al->request ?
(al->request->flags.interceptTproxy ||
- al->request->flags.intercepted) && al->cache.port :
+ al->request->flags.intercepted) && al->cache.port != NULL :
false;
if (interceptedAtKnownPort) {
const bool portAddressConfigured = !al->cache.port->s.isAnyAddr();
break;
case LFT_LOCAL_LISTENING_PORT:
- if (al->cache.port) {
+ if (al->cache.port != NULL) {
outint = al->cache.port->s.port();
doint = 1;
}
if (0 != strcmp(thisPeer->host, me))
continue;
- for (AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (thisPeer->http_port != s->s.port())
continue;
*/
#include "squid.h"
+#include "anyp/PortCfg.h"
#include "comm/Connection.h"
#include "disk.h"
#include "event.h"
sndbuf[0] = '\0';
snprintf(tbuf, 256, "cache_version SQUID/%s\n", version_string);
strcat(sndbuf, tbuf);
- assert(Config.Sockaddr.http);
+ assert(HttpPortList != NULL);
snprintf(tbuf, 256, "Running on %s %d %d\n",
getMyHostname(),
getMyPort(),
// we need to start ssl_crtd only if some port(s) need to bump SSL
bool found = false;
- for (AnyP::PortCfg *s = ::Config.Sockaddr.http; !found && s; s = s->next)
+ for (AnyP::PortCfgPointer s = HttpPortList; !found && s != NULL; s = s->next)
found = s->flags.tunnelSslBumping;
- for (AnyP::PortCfg *s = ::Config.Sockaddr.https; !found && s; s = s->next)
+ for (AnyP::PortCfgPointer s = HttpsPortList; !found && s != NULL; s = s->next)
found = s->flags.tunnelSslBumping;
if (!found)
return;
// we need to start ssl_crtd only if some port(s) need to bump SSL
bool found = false;
- for (AnyP::PortCfg *s = ::Config.Sockaddr.http; !found && s; s = s->next)
+ for (AnyP::PortCfgPointer s = HttpPortList; !found && s != NULL; s = s->next)
found = s->flags.tunnelSslBumping;
- for (AnyP::PortCfg *s = ::Config.Sockaddr.https; !found && s; s = s->next)
+ for (AnyP::PortCfgPointer s = HttpsPortList; !found && s != NULL; s = s->next)
found = s->flags.tunnelSslBumping;
if (!found)
return;
static bool
isSslServer()
{
- if (Config.Sockaddr.https)
+ if (HttpsPortList.valid())
return true;
- for (AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (s->flags.tunnelSslBumping)
return true;
}
return;
}
- for (AnyP::PortCfg *s = ::Config.Sockaddr.https; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpsPortList; s != NULL; s = s->next) {
if (s->staticSslContext.get() != NULL)
setSessionCallbacks(s->staticSslContext.get());
}
- for (AnyP::PortCfg *s = ::Config.Sockaddr.http; s; s = s->next) {
+ for (AnyP::PortCfgPointer s = HttpPortList; s != NULL; s = s->next) {
if (s->staticSslContext.get() != NULL)
setSessionCallbacks(s->staticSslContext.get());
}
host[0] = '\0';
- if (Config.Sockaddr.http && sa.isAnyAddr())
- sa = Config.Sockaddr.http->s;
+ if (HttpPortList != NULL && sa.isAnyAddr())
+ sa = HttpPortList->s;
#if USE_OPENSSL
- if (Config.Sockaddr.https && sa.isAnyAddr())
- sa = Config.Sockaddr.https->s;
+ if (HttpsPortList != NULL && sa.isAnyAddr())
+ sa = HttpsPortList->s;
#endif
int
getMyPort(void)
{
- AnyP::PortCfg *p = NULL;
- if ((p = Config.Sockaddr.http)) {
+ AnyP::PortCfgPointer p;
+ if ((p = HttpPortList) != NULL) {
// skip any special interception ports
- while (p && p->flags.isIntercepted())
+ while (p != NULL && p->flags.isIntercepted())
p = p->next;
- if (p)
+ if (p != NULL)
return p->s.port();
}
#if USE_OPENSSL
- if ((p = Config.Sockaddr.https)) {
+ if ((p = HttpsPortList) != NULL) {
// skip any special interception ports
- while (p && p->flags.isIntercepted())
+ while (p != NULL && p->flags.isIntercepted())
p = p->next;
- if (p)
+ if (p != NULL)
return p->s.port();
}
#endif