/*
- * $Id: neighbors.cc,v 1.45 1996/08/29 16:55:00 wessels Exp $
+ * $Id: neighbors.cc,v 1.46 1996/08/30 22:44:09 wessels Exp $
*
* DEBUG: section 15 Neighbor Routines
* AUTHOR: Harvest Derived
e->stats.ack_deficit++;
e->stats.pings_sent++;
- debug(15,3,"neighborsUdpPing: %s: ack_deficit = %d\n",
- e->host, e->stats.ack_deficit);
+ debug(15, 3, "neighborsUdpPing: %s: ack_deficit = %d\n",
+ e->host, e->stats.ack_deficit);
if (e->stats.ack_deficit < HIER_MAX_DEFICIT) {
/* its alive, expect a reply from it */
HIER_SOURCE_FASTEST,
0,
fqdnFromAddr(from->sin_addr));
- BIT_SET(entry->flag, ENTRY_DISPATCHED);
entry->ping_status = PING_DONE;
- getFromCache(0, entry, NULL, entry->mem_obj->request);
+ protoStart(0, entry, NULL, entry->mem_obj->request);
return;
}
} else if (header->opcode == ICP_OP_HIT_OBJ) {
e->type == EDGE_SIBLING ? HIER_SIBLING_HIT : HIER_PARENT_HIT,
0,
e->host);
- BIT_SET(entry->flag, ENTRY_DISPATCHED);
entry->ping_status = PING_DONE;
- getFromCache(0, entry, e, entry->mem_obj->request);
+ protoStart(0, entry, e, entry->mem_obj->request);
return;
}
} else if (header->opcode == ICP_OP_DECHO) {
IcpOpcodeStr[header->opcode]);
}
if (mem->e_pings_n_acks == mem->e_pings_n_pings) {
- BIT_SET(entry->flag, ENTRY_DISPATCHED);
entry->ping_status = PING_DONE;
debug(15, 6, "neighborsUdpAck: All replies received.\n");
- /* pass in fd=0 here so getFromCache() looks up the real FD
+ /* pass in fd=0 here so protoStart() looks up the real FD
* and resets the timeout handler */
getFromDefaultSource(0, entry);
return;
/*
- * $Id: redirect.cc,v 1.12 1996/08/26 22:47:55 wessels Exp $
+ * $Id: redirect.cc,v 1.13 1996/08/30 22:44:11 wessels Exp $
*
* DEBUG: section 29 Redirector
* AUTHOR: Duane Wessels
int sfd;
int len;
int fd;
+ struct timeval slp;
cfd = comm_open(COMM_NOCLOEXEC,
local_addr,
0,
comm_set_fd_lifetime(sfd, -1);
debug(29, 4, "redirect_create_redirector: FD %d connected to %s #%d.\n",
sfd, command, n_redirector++);
+ slp.tv_sec = 0;
+ slp.tv_usec = 250000;
+ select(0, NULL, NULL, NULL, &slp);
return sfd;
}
/* child */
}
dup2(fd, 0);
dup2(fd, 1);
- for (fd = 3; fd < FD_SETSIZE; fd++)
- close(fd);
+ dup2(fileno(debug_log), 2);
+ fclose(debug_log);
+ close(fd);
+ close(cfd);
execlp(command, "(redirector)", NULL);
debug(29, 0, "redirect_create_redirector: %s: %s\n", command, xstrerror());
_exit(1);
"FD %d: Connection from Redirector #%d is closed, disabling\n",
fd, redirector->index + 1);
redirector->flags = 0;
+ put_free_4k_page(redirector->inbuf);
comm_close(fd);
if (--NRedirectorsOpen == 0 && !shutdown_pending && !reread_pending)
fatal_dump("All redirectors have exited!");
/*
- * $Id: stat.cc,v 1.56 1996/08/29 16:54:16 wessels Exp $
+ * $Id: stat.cc,v 1.57 1996/08/30 22:44:12 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
}
CacheInfo->logfile_access = file_write_lock(CacheInfo->logfile_fd);
}
+
+void statCloseLog()
+{
+ file_close(CacheInfo->logfile_fd);
+}
/*
- * $Id: store.cc,v 1.91 1996/08/29 16:54:03 wessels Exp $
+ * $Id: store.cc,v 1.92 1996/08/30 22:44:13 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
e->url);
return buf;
}
+
+void storeCloseLog()
+{
+ file_close(swaplog_fd);
+ file_close(storelog_fd);
+}
/*
- * $Id: tools.cc,v 1.49 1996/08/26 19:14:54 wessels Exp $
+ * $Id: tools.cc,v 1.50 1996/08/30 22:44:15 wessels Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
PrintRusage(NULL, debug_log);
debug(21, 0, "Squid Cache (Version %s): Exiting normally.\n",
version_string);
+ storeCloseLog();
+ statCloseLog();
+ fclose(debug_log);
exit(0);
}