#include "comm/Connection.h"
#include "comm/ConnOpener.h"
#include "event.h"
-#include "forward.h"
+#include "FwdState.h"
#include "globals.h"
#include "htcp.h"
#include "HttpRequest.h"
#include "MemObject.h"
#include "mgr/Registration.h"
#include "multicast.h"
-#include "NeighborTypeDomainList.h"
#include "neighbors.h"
+#include "NeighborTypeDomainList.h"
#include "PeerDigest.h"
#include "PeerSelectState.h"
#include "RequestFlags.h"
for (p = Config.peers; p; p = p->next) {
for (j = 0; j < p->n_addresses; ++j) {
- if (from == p->addresses[j] && from.GetPort() == p->icp.port) {
+ if (from == p->addresses[j] && from.port() == p->icp.port) {
return p;
}
}
// CONNECT requests are proxy requests. Not to be forwarded to origin servers.
// Unless the destination port matches, in which case we MAY perform a 'DIRECT' to this CachePeer.
- if (p->options.originserver && request->method == Http::METHOD_CONNECT && request->port != p->in_addr.GetPort())
+ if (p->options.originserver && request->method == Http::METHOD_CONNECT && request->port != p->in_addr.port())
return false;
if (p->peer_domain == NULL && p->access == NULL)
return do_ping;
ACLFilledChecklist checklist(p->access, request, NULL);
- checklist.src_addr = request->client_addr;
- checklist.my_addr = request->my_addr;
return (checklist.fastCheck() == ACCESS_ALLOWED);
}
continue;
for (AnyP::PortCfg *s = Config.Sockaddr.http; s; s = s->next) {
- if (thisPeer->http_port != s->s.GetPort())
+ if (thisPeer->http_port != s->s.port())
continue;
debugs(15, DBG_IMPORTANT, "WARNING: Peer looks like this host");
if (np->in_addr != from)
continue;
- if (np->in_addr.GetPort() != from.GetPort())
+ if (np->in_addr.port() != from.port())
continue;
break;
if (np == NULL) {
np = (CachePeer *)xcalloc(1, sizeof(CachePeer));
np->in_addr = from;
- np->icp.port = from.GetPort();
+ np->icp.port = from.port();
np->type = PEER_NONE;
np->host = new char[MAX_IPSTRLEN];
- from.NtoA(np->host,MAX_IPSTRLEN);
+ from.toStr(np->host,MAX_IPSTRLEN);
np->next = non_peers;
non_peers = np;
}
++ p->n_addresses;
}
- p->in_addr.SetEmpty();
+ p->in_addr.setEmpty();
p->in_addr = p->addresses[0];
- p->in_addr.SetPort(p->icp.port);
+ p->in_addr.port(p->icp.port);
if (p->type == PEER_MULTICAST)
peerCountMcastPeersSchedule(p, 10);
for (int i = 0; i < p->n_addresses; ++i) {
Comm::ConnectionPointer conn = new Comm::Connection;
conn->remote = p->addresses[i];
- conn->remote.SetPort(p->http_port);
+ conn->remote.port(p->http_port);
getOutgoingAddress(NULL, conn);
++ p->testing_now;
assert(p->type == PEER_MULTICAST);
p->mcast.flags.count_event_pending = false;
snprintf(url, MAX_URL, "http://");
- p->in_addr.ToURL(url+7, MAX_URL -8 );
+ p->in_addr.toUrl(url+7, MAX_URL -8 );
strcat(url, "/");
fake = storeCreateEntry(url, url, RequestFlags(), Http::METHOD_GET);
HttpRequest *req = HttpRequest::CreateFromUrl(url);
for (i = 0; i < e->n_addresses; ++i) {
storeAppendPrintf(sentry, "Address[%d] : %s\n", i,
- e->addresses[i].NtoA(ntoabuf,MAX_IPSTRLEN) );
+ e->addresses[i].toStr(ntoabuf,MAX_IPSTRLEN) );
}
storeAppendPrintf(sentry, "Status : %s\n",
if (p->options.htcp_no_purge_clr && reason == HTCP_CLR_PURGE) {
continue;
}
- debugs(15, 3, "neighborsHtcpClear: sending CLR to " << p->in_addr.ToURL(buf, 128));
+ debugs(15, 3, "neighborsHtcpClear: sending CLR to " << p->in_addr.toUrl(buf, 128));
htcpClear(e, uri, req, method, p, reason);
}
}