Skip to content

Commit

Permalink
Fix build errors after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
yadij committed Aug 13, 2010
1 parent d74ef71 commit 5ae21d9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 53 deletions.
25 changes: 2 additions & 23 deletions src/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ static void commSetTcpNoDelay(int);
#endif
static void commSetTcpRcvbuf(int, int);
static PF commHandleWrite;
static IPH commConnectDnsHandle;

typedef enum {
COMM_CB_READ = 1,
Expand Down Expand Up @@ -850,27 +849,7 @@ comm_import_opened(int fd,
*/
}

static void
copyFDFlags(int to, fde *F)
{
if (F->flags.close_on_exec)
commSetCloseOnExec(to);

if (F->flags.nonblocking)
commSetNonBlocking(to);

#ifdef TCP_NODELAY

if (F->flags.nodelay)
commSetTcpNoDelay(to);

#endif

if (Config.tcpRcvBufsz > 0)
commSetTcpRcvbuf(to, Config.tcpRcvBufsz);
}

/*
#if 0
int
commSetTimeout_old(int fd, int timeout, PF * handler, void *data)
{
Expand All @@ -896,7 +875,7 @@ commSetTimeout_old(int fd, int timeout, PF * handler, void *data)

return F->timeout;
}
*/
#endif

int
commSetTimeout(int fd, int timeout, PF * handler, void *data)
Expand Down
2 changes: 1 addition & 1 deletion src/comm/Connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Comm::Connection::~Connection()
cbdataReferenceDone(_peer);
}

Comm::ConnectionPointer &
Comm::ConnectionPointer
Comm::Connection::copyDetails() const
{
ConnectionPointer c = new Comm::Connection;
Expand Down
2 changes: 1 addition & 1 deletion src/comm/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Connection : public RefCountable
/** Copy an existing connections IP and properties.
* This excludes the FD. The new copy will be a closed connection.
*/
ConnectionPointer & copyDetails() const;
ConnectionPointer copyDetails() const;

/** Close any open socket. */
void close();
Expand Down
48 changes: 20 additions & 28 deletions src/peer_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ static const char *DirectStr[] = {

static void peerSelectFoo(ps_state *);
static void peerPingTimeout(void *data);
static void peerSelectCallback(ps_state * psstate);
static IRCB peerHandlePingReply;
static void peerSelectStateFree(ps_state * psstate);
static void peerIcpParentMiss(peer *, icp_common_t *, ps_state *);
Expand All @@ -83,6 +82,15 @@ CBDATA_CLASS_INIT(ps_state);
static void
peerSelectStateFree(ps_state * psstate)
{
if (psstate->entry) {
debugs(44, 3, HERE << psstate->entry->url());

if (psstate->entry->ping_status == PING_WAITING)
eventDelete(peerPingTimeout, psstate);

psstate->entry->ping_status = PING_DONE;
}

if (psstate->acl_checklist) {
debugs(44, 1, "calling aclChecklistFree() from peerSelectStateFree");
delete (psstate->acl_checklist);
Expand Down Expand Up @@ -183,32 +191,6 @@ peerCheckAlwaysDirectDone(int answer, void *data)
peerSelectFoo(psstate);
}

static void
peerSelectCallback(ps_state * psstate)
{
StoreEntry *entry = psstate->entry;
FwdServer *fs = psstate->servers;

if (entry) {
debugs(44, 3, "peerSelectCallback: " << entry->url() );

if (entry->ping_status == PING_WAITING)
eventDelete(peerPingTimeout, psstate);

entry->ping_status = PING_DONE;
}

if (fs == NULL) {
debugs(44, 1, "Failed to select source for '" << entry->url() << "'" );
debugs(44, 1, " always_direct = " << psstate->always_direct );
debugs(44, 1, " never_direct = " << psstate->never_direct );
debugs(44, 1, " timedout = " << psstate->ping.timedout );
}

psstate->ping.stop = current_time;
psstate->request->hier.ping = psstate->ping;
}

void
peerSelectDnsPaths(ps_state *psstate)
{
Expand All @@ -227,7 +209,17 @@ peerSelectDnsPaths(ps_state *psstate)
PSC *callback = psstate->callback;
psstate->callback = NULL;

debugs(44, 2, "Found IP destination for: " << psstate->entry->url() << "'");
if (psstate->paths->size() < 1) {
debugs(44, DBG_IMPORTANT, "Failed to select source for '" << psstate->entry->url() << "'" );
debugs(44, DBG_IMPORTANT, " always_direct = " << psstate->always_direct );
debugs(44, DBG_IMPORTANT, " never_direct = " << psstate->never_direct );
debugs(44, DBG_IMPORTANT, " timedout = " << psstate->ping.timedout );
} else {
debugs(44, 2, "Found IP destination for: " << psstate->entry->url() << "'");
}

psstate->ping.stop = current_time;
psstate->request->hier.ping = psstate->ping;

void *cbdata;
if (cbdataReferenceValidDone(psstate->callback_data, &cbdata)) {
Expand Down

0 comments on commit 5ae21d9

Please sign in to comment.