diff --context --recursive squid-1.1.15/src/Makefile.in squid-1.1.15.ucs.3/src/Makefile.in *** squid-1.1.15/src/Makefile.in Sat Aug 9 04:36:16 1997 --- squid-1.1.15.ucs.3/src/Makefile.in Thu Aug 14 17:12:22 1997 *************** *** 5,15 **** # # Uncomment and customize the following to suit your needs: # ! HOST_OPT = # -DCACHEMGR_HOSTNAME="getfullhostname()" AUTH_OPT = # -DUSE_PROXY_AUTH=1 LOG_HDRS_OPT = # -DLOG_FULL_HEADERS=1 ICMP_OPT = # -DUSE_ICMP=1 ! DELAY_HACK = # -DDELAY_HACK=1 USERAGENT_OPT = # -DUSE_USERAGENT_LOG=1 KILL_PARENT_OPT = # -DKILL_PARENT_OPT USE_POLL_OPT = # -DUSE_POLL --- 5,15 ---- # # Uncomment and customize the following to suit your needs: # ! HOST_OPT = -DCACHEMGR_HOSTNAME="getfullhostname()" AUTH_OPT = # -DUSE_PROXY_AUTH=1 LOG_HDRS_OPT = # -DLOG_FULL_HEADERS=1 ICMP_OPT = # -DUSE_ICMP=1 ! DELAY_HACK = -DDELAY_HACK=1 USERAGENT_OPT = # -DUSE_USERAGENT_LOG=1 KILL_PARENT_OPT = # -DKILL_PARENT_OPT USE_POLL_OPT = # -DUSE_POLL *************** *** 17,28 **** USE_SPLAY_TREE = # -DUSE_SPLAY_TREE USE_BIN_TREE = # -DUSE_BIN_TREE RELOAD_INTO_IMS = # -DRELOAD_INTO_IMS DEFINES = $(HOST_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) \ $(ICMP_OPT) $(DELAY_HACK) $(USERAGENT_OPT) \ $(KILL_PARENT_OPT) $(USE_POLL_OPT) \ $(USE_SPLAY_TREE) $(USE_BIN_TREE) \ ! $(RELOAD_INTO_IMS) prefix = @prefix@ exec_prefix = @exec_prefix@ --- 17,31 ---- USE_SPLAY_TREE = # -DUSE_SPLAY_TREE USE_BIN_TREE = # -DUSE_BIN_TREE RELOAD_INTO_IMS = # -DRELOAD_INTO_IMS + UDP_OPT = -DNO_LOG_UDP + TIMING_OPT = -DLESS_TIMING DEFINES = $(HOST_OPT) $(AUTH_OPT) $(LOG_HDRS_OPT) \ $(ICMP_OPT) $(DELAY_HACK) $(USERAGENT_OPT) \ $(KILL_PARENT_OPT) $(USE_POLL_OPT) \ $(USE_SPLAY_TREE) $(USE_BIN_TREE) \ ! $(RELOAD_INTO_IMS) $(UDP_OPT) \ ! $(TIMING_OPT) prefix = @prefix@ exec_prefix = @exec_prefix@ diff --context --recursive squid-1.1.15/src/acl.c squid-1.1.15.ucs.3/src/acl.c *** squid-1.1.15/src/acl.c Fri Apr 25 03:43:17 1997 --- squid-1.1.15.ucs.3/src/acl.c Thu Aug 14 17:07:18 1997 *************** *** 46,53 **** struct _acl_access *HTTPAccessList = NULL; struct _acl_access *ICPAccessList = NULL; struct _acl_access *MISSAccessList = NULL; ! #if DELAY_HACK struct _acl_access *DelayAccessList = NULL; #endif static struct _acl *AclList = NULL; --- 46,54 ---- struct _acl_access *HTTPAccessList = NULL; struct _acl_access *ICPAccessList = NULL; struct _acl_access *MISSAccessList = NULL; ! #ifdef DELAY_HACK struct _acl_access *DelayAccessList = NULL; + struct _acl_access *DelayChildAccessList = NULL; #endif static struct _acl *AclList = NULL; diff --context --recursive squid-1.1.15/src/acl.h squid-1.1.15.ucs.3/src/acl.h *** squid-1.1.15/src/acl.h Fri Feb 21 05:03:10 1997 --- squid-1.1.15.ucs.3/src/acl.h Thu Aug 14 17:07:18 1997 *************** *** 150,155 **** extern struct _acl_deny_info_list *DenyInfoList; extern const char *AclMatchedName; ! #if DELAY_HACK extern struct _acl_access *DelayAccessList; #endif --- 150,156 ---- extern struct _acl_deny_info_list *DenyInfoList; extern const char *AclMatchedName; ! #ifdef DELAY_HACK extern struct _acl_access *DelayAccessList; + extern struct _acl_access *DelayChildAccessList; #endif diff --context --recursive squid-1.1.15/src/cache_cf.c squid-1.1.15.ucs.3/src/cache_cf.c *** squid-1.1.15/src/cache_cf.c Fri Aug 8 04:34:30 1997 --- squid-1.1.15.ucs.3/src/cache_cf.c Thu Mar 26 18:15:51 1998 *************** *** 117,122 **** --- 117,135 ---- #define DefaultNetdbLow 900 #define DefaultNetdbPeriod 300 /* 5 minutes */ + #ifdef DELAY_HACK + #define DefaultDelayMaxBytes 102400 + #define DefaultDelayRestoreBytes 3584 + #define DefaultDelayHostMaxBytes 10240 + #define DefaultDelayHostRestoreBytes 384 + #define DefaultDelayNetMaxBytes 32768 + #define DefaultDelayNetRestoreBytes 1024 + #define DefaultDelayChildMaxBytes 204800 + #define DefaultDelayChildRestoreBytes 8192 + #define DefaultDelayChildHostMaxBytes 32768 + #define DefaultDelayChildHostRestoreBytes 1024 + #endif + #define DefaultWaisRelayHost (char *)NULL #define DefaultWaisRelayPort 0 *************** *** 238,243 **** --- 251,268 ---- static void parseAppendDomainLine _PARAMS((void)); static void parseCacheAnnounceLine _PARAMS((void)); static void parseCacheHostLine _PARAMS((void)); + #ifdef DELAY_HACK + static void parseDelayRestoreLine _PARAMS((void)); + static void parseDelayHostRestoreLine _PARAMS((void)); + static void parseDelayNetRestoreLine _PARAMS((void)); + static void parseDelayChildRestoreLine _PARAMS((void)); + static void parseDelayChildHostRestoreLine _PARAMS((void)); + static void parseDelayMaxLine _PARAMS((void)); + static void parseDelayHostMaxLine _PARAMS((void)); + static void parseDelayNetMaxLine _PARAMS((void)); + static void parseDelayChildMaxLine _PARAMS((void)); + static void parseDelayChildHostMaxLine _PARAMS((void)); + #endif static void parseEffectiveUserLine _PARAMS((void)); static void parseToEndOfLine _PARAMS((char *volatile *)); static void parseFtpUserLine _PARAMS((void)); *************** *** 495,500 **** --- 520,529 ---- options |= NEIGHBOR_NO_QUERY; } else if (!strcasecmp(token, "multicast-responder")) { options |= NEIGHBOR_MCAST_RESPONDER; + #ifdef DELAY_HACK + } else if (!strcasecmp(token, "no-delay")) { + options |= NEIGHBOR_NO_DELAY; + #endif } else if (!strncasecmp(token, "weight=", 7)) { weight = atoi(token + 7); } else if (!strncasecmp(token, "ttl=", 4)) { *************** *** 874,879 **** --- 903,1000 ---- Config.Port.icp = (u_short) i; } + #ifdef DELAY_HACK + static + void parseDelayRestoreLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.restore = i; /* number of bytes per sec to give to pool */ + } + + static void + parseDelayHostRestoreLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.host_restore = i; /* ditto, per-host pool */ + } + + static void + parseDelayNetRestoreLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.net_restore = i; /* ditto, per-net pool */ + } + + static void + parseDelayChildRestoreLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.child_restore = i; /* ditto, child pool */ + } + + static void + parseDelayChildHostRestoreLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.child_host_restore = i; /* ditto, child pool, per host */ + } + + static void + parseDelayMaxLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.max = i; /* max number of bytes in pool */ + } + + static void + parseDelayHostMaxLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.host_max = i; /* ditto, per-host pool */ + } + + static void + parseDelayNetMaxLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.net_max = i; /* ditto, per-net pool */ + } + + static void + parseDelayChildMaxLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.child_max = i; /* ditto, child pool */ + } + + static void + parseDelayChildHostMaxLine() + { + char *token; + int i; + GetInteger(i); + Config.delay.child_host_max = i; /* ditto, child pool, per host */ + } + #endif + static void parseVisibleHostnameLine(void) { *************** *** 1036,1043 **** aclDestroyAccessList(&HTTPAccessList); aclDestroyAccessList(&MISSAccessList); aclDestroyAccessList(&ICPAccessList); ! #if DELAY_HACK aclDestroyAccessList(&DelayAccessList); #endif aclDestroyRegexList(Config.cache_stop_relist); Config.cache_stop_relist = NULL; --- 1157,1165 ---- aclDestroyAccessList(&HTTPAccessList); aclDestroyAccessList(&MISSAccessList); aclDestroyAccessList(&ICPAccessList); ! #ifdef DELAY_HACK aclDestroyAccessList(&DelayAccessList); + aclDestroyAccessList(&DelayChildAccessList); #endif aclDestroyRegexList(Config.cache_stop_relist); Config.cache_stop_relist = NULL; *************** *** 1161,1169 **** else if (!strcmp(token, "cache_stoplist_pattern/i")) aclParseRegexList(&Config.cache_stop_relist, 1); ! #if DELAY_HACK else if (!strcmp(token, "delay_access")) aclParseAccessLine(&DelayAccessList); #endif else if (!strcmp(token, "refresh_pattern")) --- 1283,1324 ---- else if (!strcmp(token, "cache_stoplist_pattern/i")) aclParseRegexList(&Config.cache_stop_relist, 1); ! #ifdef DELAY_HACK else if (!strcmp(token, "delay_access")) aclParseAccessLine(&DelayAccessList); + + else if (!strcmp(token, "delay_child_access")) + aclParseAccessLine(&DelayChildAccessList); + + else if (!strcmp(token, "delay_max")) + parseDelayMaxLine(); + + else if (!strcmp(token, "delay_restore")) + parseDelayRestoreLine(); + + else if (!strcmp(token, "delay_host_max")) + parseDelayHostMaxLine(); + + else if (!strcmp(token, "delay_host_restore")) + parseDelayHostRestoreLine(); + + else if (!strcmp(token, "delay_net_max")) + parseDelayNetMaxLine(); + + else if (!strcmp(token, "delay_net_restore")) + parseDelayNetRestoreLine(); + + else if (!strcmp(token, "delay_child_max")) + parseDelayChildMaxLine(); + + else if (!strcmp(token, "delay_child_restore")) + parseDelayChildRestoreLine(); + + else if (!strcmp(token, "delay_child_host_max")) + parseDelayChildHostMaxLine(); + + else if (!strcmp(token, "delay_child_host_restore")) + parseDelayChildHostRestoreLine(); #endif else if (!strcmp(token, "refresh_pattern")) *************** *** 1579,1584 **** --- 1734,1751 ---- /* Config.proxyAuth.IgnoreDomains = safe_xstrdup(DefaultproxyAuthIgnoreDomains); */ #endif /* USE_PROXY_AUTH */ Config.ftpUser = safe_xstrdup(DefaultFtpUser); + #ifdef DELAY_HACK + Config.delay.max = DefaultDelayMaxBytes; + Config.delay.restore = DefaultDelayRestoreBytes; + Config.delay.host_max = DefaultDelayHostMaxBytes; + Config.delay.host_restore = DefaultDelayHostRestoreBytes; + Config.delay.net_max = DefaultDelayNetMaxBytes; + Config.delay.net_restore = DefaultDelayNetRestoreBytes; + Config.delay.child_max = DefaultDelayChildMaxBytes; + Config.delay.child_restore = DefaultDelayChildRestoreBytes; + Config.delay.child_host_max = DefaultDelayChildHostMaxBytes; + Config.delay.child_host_restore = DefaultDelayChildHostRestoreBytes; + #endif Config.Announce.host = safe_xstrdup(DefaultAnnounceHost); Config.Announce.port = DefaultAnnouncePort; Config.Announce.file = safe_xstrdup(DefaultAnnounceFile); diff --context --recursive squid-1.1.15/src/cache_cf.h squid-1.1.15.ucs.3/src/cache_cf.h *** squid-1.1.15/src/cache_cf.h Fri Aug 8 04:49:23 1997 --- squid-1.1.15.ucs.3/src/cache_cf.h Thu Mar 26 18:14:52 1998 *************** *** 205,210 **** --- 205,224 ---- int neighborTimeout; int stallDelay; int singleParentBypass; + #ifdef DELAY_HACK + struct { + int restore; + int max; + int host_restore; + int host_max; + int net_restore; + int net_max; + int child_restore; + int child_max; + int child_host_restore; + int child_host_max; + } delay; + #endif struct { char *host; char *prefix; diff --context --recursive squid-1.1.15/src/cachemgr.c squid-1.1.15.ucs.3/src/cachemgr.c *** squid-1.1.15/src/cachemgr.c Sat Jun 14 01:00:08 1997 --- squid-1.1.15.ucs.3/src/cachemgr.c Thu Aug 14 17:07:18 1997 *************** *** 229,234 **** --- 229,237 ---- STATS_VM, STATS_U, STATS_IO, + #ifdef DELAY_HACK + STATS_DH, + #endif STATS_HDRS, STATS_FDS, STATS_NETDB, *************** *** 256,261 **** --- 259,267 ---- "stats/vm_objects", "stats/utilization", "stats/io", + #ifdef DELAY_HACK + "stats/delay", + #endif "stats/reply_headers", "stats/filedescriptors", "stats/netdb", *************** *** 283,288 **** --- 289,297 ---- "VM Objects", "Utilization", "I/O", + #ifdef DELAY_HACK + "Delay Pool Statistics", + #endif "HTTP Reply Headers", "Filedescriptor Usage", "Network Probe Database", *************** *** 369,374 **** --- 378,386 ---- #endif print_option(op, STATS_U); print_option(op, STATS_IO); + #ifdef DELAY_HACK + print_option(op, STATS_DH); + #endif print_option(op, STATS_HDRS); print_option(op, STATS_FDS); print_option(op, STATS_NETDB); *************** *** 740,745 **** --- 752,760 ---- case STATS_VM: case STATS_U: case STATS_IO: + #ifdef DELAY_HACK + case STATS_DH: + #endif case STATS_HDRS: case STATS_FDS: case STATS_NETDB: *************** *** 779,784 **** --- 794,802 ---- #endif print_option(op, STATS_U); print_option(op, STATS_IO); + #ifdef DELAY_HACK + print_option(op, STATS_DH); + #endif print_option(op, STATS_HDRS); print_option(op, STATS_FDS); print_option(op, STATS_NETDB); *************** *** 835,840 **** --- 853,861 ---- case STATS_O: case STATS_VM: case STATS_IO: + #ifdef DELAY_HACK + case STATS_DH: + #endif case STATS_HDRS: case STATS_FDS: case STATS_NETDB: *************** *** 921,926 **** --- 942,950 ---- case STATS_D: case STATS_R: case STATS_IO: + #ifdef DELAY_HACK + case STATS_DH: + #endif case STATS_HDRS: case STATS_FDS: case STATS_NETDB: diff --context --recursive squid-1.1.15/src/comm.c squid-1.1.15.ucs.3/src/comm.c *** squid-1.1.15/src/comm.c Sat Aug 9 02:01:46 1997 --- squid-1.1.15.ucs.3/src/comm.c Tue Mar 31 13:26:33 1998 *************** *** 129,134 **** --- 129,144 ---- void (*free) (void *); }; + #ifdef DELAY_HACK + struct _delay_data delay_data; + unsigned char delay_nets[256]; + long delay_net_matrix[255]; + unsigned char delay_hosts[255][256]; + long delay_host_matrix[65279]; + unsigned char delay_child_hosts[256]; + long delay_child_host_matrix[255]; + #endif + /* GLOBAL */ FD_ENTRY *fd_table = NULL; /* also used in disk.c */ *************** *** 971,976 **** --- 981,991 ---- static time_t last_timeout = 0; struct timeval poll_time; time_t timeout; + #ifdef DELAY_HACK + long maxbyte, restbyte, maxnetbyte, restnetbyte; + int net, host, mpos; + int time_diff; + #endif /* assume all process are very fast (less than 1 second). Call * time() only once */ *************** *** 978,983 **** --- 993,1056 ---- /* use only 1 second granularity */ timeout = squid_curtime + sec; + #ifdef DELAY_HACK + if (squid_curtime > delay_data.last_update) { + time_diff = squid_curtime - delay_data.last_update; + delay_data.last_update = squid_curtime; + delay_data.bytes += Config.delay.restore * time_diff; + debug(5, 2, "comm_select: DELAY incremented main pool, now = %d\n", delay_data.bytes); + if (delay_data.bytes > (maxbyte = Config.delay.max)) { + delay_data.bytes = maxbyte; + debug(5, 5, "comm_select: DELAY bytes set to max %d\n", maxbyte); + } + delay_data.child_bytes += Config.delay.child_restore * time_diff; + debug(5, 2, "comm_select: DELAY CHILD pool incremented, now = %d\n", delay_data.child_bytes); + if (delay_data.child_bytes > (maxbyte = Config.delay.child_max)) { + delay_data.child_bytes = maxbyte; + debug(5, 5, "comm_select: DELAY CHILD bytes set to max %d\n", maxbyte); + } + maxbyte = Config.delay.child_host_max; + restbyte = Config.delay.child_host_restore * time_diff; + for(host=0;;host++) { + if(delay_child_hosts[host] == 255) + break; + debug(5, 3, "comm_select: DELAY incrementing child host %d\n", host); + if(delay_child_host_matrix[host] != maxbyte) { + delay_child_host_matrix[host] += restbyte; + if(delay_child_host_matrix[host] > maxbyte) + delay_child_host_matrix[host] = maxbyte; + } + } + maxbyte = Config.delay.host_max; + restbyte = Config.delay.host_restore * time_diff; + maxnetbyte = Config.delay.net_max; + restnetbyte = Config.delay.net_restore * time_diff; + for(net=0;;net++) { + if(delay_nets[net] == 255) + break; + debug(5, 2, "comm_select: DELAY scanning net %d\n", net); + if(delay_net_matrix[net] != maxnetbyte) { + debug(5, 3, "comm_select: DELAY incrementing net %d\n", net); + delay_net_matrix[net] += restnetbyte; + if(delay_net_matrix[net] > maxnetbyte) + delay_net_matrix[net] = maxnetbyte; + } + mpos = (net << 8); + for(host=0;;host++) { + if(delay_hosts[net][host] == 255) + break; + debug(5, 3, "comm_select: DELAY incrementing host %d\n", host); + if(delay_host_matrix[mpos] != maxbyte) { + delay_host_matrix[mpos] += restbyte; + if(delay_host_matrix[mpos] > maxbyte) + delay_host_matrix[mpos] = maxbyte; + } + mpos++; + } + } + } + #endif + do { if (sec > 60) fatal_dump(NULL); *************** *** 1329,1334 **** --- 1402,1417 ---- meta_data.misc += Squid_MaxFD * sizeof(int); zero_tv.tv_sec = 0; zero_tv.tv_usec = 0; + + #ifdef DELAY_HACK + /* this bit sets up the structure that holds the delay_data info. */ + + delay_data.bytes = Config.delay.restore; + delay_data.child_bytes = Config.delay.child_restore; + delay_data.last_update = getCurrentTime(); + delay_nets[0] = 255; + delay_child_hosts[0] = 255; + #endif return 0; } diff --context --recursive squid-1.1.15/src/comm.h squid-1.1.15.ucs.3/src/comm.h *** squid-1.1.15/src/comm.h Sun Jun 1 07:14:01 1997 --- squid-1.1.15.ucs.3/src/comm.h Thu Mar 26 18:19:47 1998 *************** *** 131,136 **** --- 131,152 ---- #define FD_ASCII_NOTE_SZ 64 + #ifdef DELAY_HACK + struct _delay_data { + time_t last_update; + long bytes; + long child_bytes; + }; + + extern struct _delay_data delay_data; + extern unsigned char delay_nets[256]; + extern long delay_net_matrix[255]; + extern unsigned char delay_hosts[255][256]; + extern long delay_host_matrix[65279]; + extern unsigned char delay_child_hosts[256]; + extern long delay_child_host_matrix[255]; + #endif + struct close_handler { PF handler; void *data; diff --context --recursive squid-1.1.15/src/ftp.c squid-1.1.15.ucs.3/src/ftp.c *** squid-1.1.15/src/ftp.c Fri Jul 11 05:10:35 1997 --- squid-1.1.15.ucs.3/src/ftp.c Tue Mar 31 17:29:10 1998 *************** *** 269,285 **** --- 269,303 ---- int clen; int off; int bin; + #ifdef DELAY_HACK + int bufsize, d_m_p; + unsigned char d_c_p; + #endif StoreEntry *entry = data->entry; /* check if we want to defer reading */ clen = entry->mem_obj->e_current_len; off = storeGetLowestReaderOffset(entry); + #ifdef DELAY_HACK + d_m_p = data->request->delay_matrix_pos; + d_c_p = data->request->delay_child_pos; + if ((clen - off) > FTP_DELETE_GAP || + (d_c_p != 255 && (delay_data.child_bytes <= 0 || delay_child_host_matrix[d_c_p] < 0)) || + (d_m_p != 65535 && (delay_data.bytes <= 0 || delay_host_matrix[d_m_p] <= 0 || + delay_net_matrix[d_m_p>>8] <= 0))) { + #else if ((clen - off) > FTP_DELETE_GAP) { + #endif if (entry->flag & CLIENT_ABORT_REQUEST) { squid_error_entry(entry, ERR_CLIENT_ABORT, NULL); comm_close(fd); } IOStats.Ftp.reads_deferred++; + #ifdef DELAY_HACK + if (d_c_p != 255 || d_m_p != 65535) { + debug(11, 2, "ftpReadReply: DELAY Read deferred for Object: %s\n", entry->url); + } + #endif debug(11, 3, "ftpReadReply: Read deferred for Object: %s\n", entry->url); debug(11, 3, " Current Gap: %d bytes\n", clen - off); *************** *** 300,306 **** --- 318,357 ---- BIT_RESET(entry->flag, READ_DEFERRED); } errno = 0; + #ifdef DELAY_HACK + if (d_m_p != 65535) { + bufsize = delay_data.bytes / 16; + if (bufsize > delay_host_matrix[d_m_p]) + bufsize = delay_host_matrix[d_m_p]; + if (bufsize > delay_net_matrix[d_m_p>>8] / 4) + bufsize = delay_net_matrix[d_m_p>>8] / 4; + if (bufsize < (SQUID_TCP_SO_RCVBUF / 64)) + bufsize = SQUID_TCP_SO_RCVBUF / 64; + } else if (d_c_p != 255) { + bufsize = delay_data.child_bytes / 16; + if (bufsize > delay_child_host_matrix[d_c_p]) + bufsize = delay_child_host_matrix[d_c_p]; + if (bufsize < (SQUID_TCP_SO_RCVBUF / 64)) + bufsize = SQUID_TCP_SO_RCVBUF / 64; + } else + bufsize = SQUID_TCP_SO_RCVBUF; + len = read(fd, buf, bufsize); + if (d_m_p != 65535) { + delay_data.bytes -= len; + delay_host_matrix[d_m_p] -= len; + delay_net_matrix[d_m_p >> 8] -= len; + debug(11, 2, "ftpReadReply: DELAY %d bytes read. Host pool = %d\n", len, delay_host_matrix[d_m_p]); + debug(11, 2, "ftpReadReply: DELAY %d bytes read. Net pool = %d\n", len, delay_net_matrix[d_m_p>>8]); + debug(11, 2, "ftpReadReply: DELAY %d bytes read. Pool = %d\n", len, delay_data.bytes); + } else if (d_c_p != 255) { + delay_data.child_bytes -= len; + delay_child_host_matrix[d_c_p] -= len; + debug(11, 2, "ftpReadReply: DELAY CHILD %d bytes read. Host pool = %d\n", len, delay_child_host_matrix[d_c_p]); + debug(11, 2, "ftpReadReply: DELAY CHILD %d bytes read. Pool = %d\n", len, delay_data.child_bytes); + } + #else len = read(fd, buf, SQUID_TCP_SO_RCVBUF); + #endif debug(9, 5, "ftpReadReply: FD %d, Read %d bytes\n", fd, len); if (len > 0) { IOStats.Ftp.reads++; diff --context --recursive squid-1.1.15/src/http.c squid-1.1.15.ucs.3/src/http.c *** squid-1.1.15/src/http.c Fri Aug 8 07:46:24 1997 --- squid-1.1.15.ucs.3/src/http.c Tue Mar 31 17:52:53 1998 *************** *** 110,115 **** --- 110,116 ---- #include "squid.h" + #define HTTP_DELETE_GAP (1<<18) static const char *const crlf = "\r\n"; *************** *** 550,566 **** --- 551,586 ---- int bin; int clen; int off; + #ifdef DELAY_HACK + int bufsize, d_m_p; + unsigned char d_c_p; + #endif StoreEntry *entry = httpState->entry; /* check if we want to defer reading */ clen = entry->mem_obj->e_current_len; off = storeGetLowestReaderOffset(entry); + #ifdef DELAY_HACK + d_m_p = httpState->request->delay_matrix_pos; + d_c_p = httpState->request->delay_child_pos; + if ((clen - off) > HTTP_DELETE_GAP || + (d_c_p != 255 && (delay_data.child_bytes <= 0 || delay_child_host_matrix[d_c_p] < 0)) || + (d_m_p != 65535 && (delay_data.bytes <= 0 || delay_host_matrix[d_m_p] <= 0 || + delay_net_matrix[d_m_p>>8] <= 0))) { + #else if ((clen - off) > HTTP_DELETE_GAP) { + #endif if (entry->flag & CLIENT_ABORT_REQUEST) { squid_error_entry(entry, ERR_CLIENT_ABORT, NULL); comm_close(fd); return; } IOStats.Http.reads_deferred++; + #ifdef DELAY_HACK + if (d_c_p != 255 || d_m_p != 65535) { + debug(11, 2, "httpReadReply: DELAY Read deferred for Object: %s\n", entry->url); + } + #endif + debug(11, 3, "httpReadReply: Read deferred for Object: %s\n", entry->url); debug(11, 3, " Current Gap: %d bytes\n", clen - off); *************** *** 587,593 **** --- 607,646 ---- BIT_RESET(entry->flag, READ_DEFERRED); } errno = 0; + #ifdef DELAY_HACK + if (d_m_p != 65535) { + bufsize = delay_data.bytes / 16; + if (bufsize > delay_host_matrix[d_m_p]) + bufsize = delay_host_matrix[d_m_p]; + if (bufsize > delay_net_matrix[d_m_p>>8] / 4) + bufsize = delay_net_matrix[d_m_p>>8] / 4; + if (bufsize < (SQUID_TCP_SO_RCVBUF / 64)) + bufsize = SQUID_TCP_SO_RCVBUF / 64; + } else if (d_c_p != 255) { + bufsize = delay_data.child_bytes / 16; + if (bufsize > delay_child_host_matrix[d_c_p]) + bufsize = delay_child_host_matrix[d_c_p]; + if (bufsize < (SQUID_TCP_SO_RCVBUF / 64)) + bufsize = SQUID_TCP_SO_RCVBUF / 64; + } else + bufsize = SQUID_TCP_SO_RCVBUF; + len = read(fd, buf, bufsize); + if (d_m_p != 65535) { + delay_data.bytes -= len; + delay_host_matrix[d_m_p] -= len; + delay_net_matrix[d_m_p >> 8] -= len; + debug(11, 2, "httpReadReply: DELAY %d bytes read. Host pool = %d\n", len, delay_host_matrix[d_m_p]); + debug(11, 2, "httpReadReply: DELAY %d bytes read. Net pool = %d\n", len, delay_net_matrix[d_m_p>>8]); + debug(11, 2, "httpReadReply: DELAY %d bytes read. Pool = %d\n", len, delay_data.bytes); + } else if (d_c_p != 255) { + delay_data.child_bytes -= len; + delay_child_host_matrix[d_c_p] -= len; + debug(11, 2, "httpReadReply: DELAY CHILD %d bytes read. Host pool = %d\n", len, delay_child_host_matrix[d_c_p]); + debug(11, 2, "httpReadReply: DELAY CHILD %d bytes read. Pool = %d\n", len, delay_data.child_bytes); + } + #else len = read(fd, buf, SQUID_TCP_SO_RCVBUF); + #endif debug(11, 5, "httpReadReply: FD %d: len %d.\n", fd, len); if (len > 0) { comm_set_fd_lifetime(fd, 86400); /* extend after good read */ *************** *** 899,904 **** --- 952,964 ---- if (e->options & NEIGHBOR_PROXY_ONLY) storeStartDeleteBehind(entry); + #ifdef DELAY_HACK + if (e->options & NEIGHBOR_NO_DELAY) { + orig_request->delay_child_pos = 255; + orig_request->delay_matrix_pos = 65535; + } + #endif + /* Create socket. */ sock = comm_open(SOCK_STREAM, 0, *************** *** 916,921 **** --- 976,985 ---- httpState->req_hdr = entry->mem_obj->mime_hdr; httpState->req_hdr_sz = entry->mem_obj->mime_hdr_sz; request = get_free_request_t(); + #ifdef DELAY_HACK + request->delay_child_pos = orig_request->delay_child_pos; + request->delay_matrix_pos = orig_request->delay_matrix_pos; + #endif httpState->request = requestLink(request); httpState->neighbor = e; httpState->orig_request = requestLink(orig_request); diff --context --recursive squid-1.1.15/src/icp.c squid-1.1.15.ucs.3/src/icp.c *** squid-1.1.15/src/icp.c Sat Aug 9 04:35:20 1997 --- squid-1.1.15.ucs.3/src/icp.c Tue Mar 31 17:45:47 1998 *************** *** 121,132 **** --- 121,134 ---- "TCP_IMS_MISS", "TCP_SWAPFAIL", "TCP_DENIED", + #ifndef NO_LOG_UDP "UDP_HIT", "UDP_HIT_OBJ", "UDP_MISS", "UDP_DENIED", "UDP_INVALID", "UDP_MISS_NOFETCH", + #endif "ERR_READ_TIMEOUT", "ERR_LIFETIME_EXP", "ERR_NO_CLIENTS", *************** *** 147,156 **** "ERR_PROXY_DENIED" }; - #if DELAY_HACK - int _delay_fetch; - - #endif static icpUdpData *UdpQueueHead = NULL; static icpUdpData *UdpQueueTail = NULL; --- 149,154 ---- *************** *** 176,182 **** --- 174,182 ---- static void icpHandleStoreIMS _PARAMS((int, StoreEntry *, void *)); static void icpHandleIMSComplete _PARAMS((int, char *, int, int, void *icpState)); static void icpHitObjHandler _PARAMS((int, void *)); + #ifndef NO_LOG_UDP static void icpLogIcp _PARAMS((icpUdpData *)); + #endif static void icpHandleIcpV2 _PARAMS((int, struct sockaddr_in, char *, int)); static void icpHandleIcpV3 _PARAMS((int, struct sockaddr_in, char *, int)); static void icpHandleAbort _PARAMS((int fd, StoreEntry *, void *)); *************** *** 913,918 **** --- 913,922 ---- icpState->method, icpState->url, fd_table[fd].ipaddr); + #ifdef DELAY_HACK + icpState->request->delay_child_pos = 255; + icpState->request->delay_matrix_pos = 65535; + #endif icpSendERROR(fd, LOG_TCP_DENIED, buf, icpState, icpState->http_code); return 0; } *************** *** 936,951 **** icpState->out_offset = 0; /* Register with storage manager to receive updates when data comes in. */ storeRegister(entry, fd, icpHandleStore, (void *) icpState); ! #if DELAY_HACK ch.src_addr = icpState->peer.sin_addr; ! ch.request = icpState->request; ! _delay_fetch = 0; ! if (aclCheck(DelayAccessList, &ch)) ! _delay_fetch = 1; #endif return (protoDispatch(fd, url, icpState->entry, icpState->request)); } static void icpLogIcp(icpUdpData * queue) { --- 940,1004 ---- icpState->out_offset = 0; /* Register with storage manager to receive updates when data comes in. */ storeRegister(entry, fd, icpHandleStore, (void *) icpState); ! #ifdef DELAY_HACK ch.src_addr = icpState->peer.sin_addr; ! ch.request = requestLink(icpState->request); ! icpState->request->delay_child_pos = 255; ! icpState->request->delay_matrix_pos = 65535; ! if (aclCheck(DelayAccessList, &ch)) { ! unsigned int host, net, Host, Net; ! ! debug(12, 5, "icpProcessMISS: delay set %s\n", inet_ntoa(ch.src_addr)); ! Host = (Net = ntohl(ch.src_addr.s_addr) & 0xffff) & 0xff; ! Net >>= 8; ! for(net = 0;; net++) { ! if (delay_nets[net] == Net) ! break; ! if (delay_nets[net] == 255) { ! delay_nets[net] = Net; ! delay_nets[net + 1] = 255; ! delay_hosts[net][0] = 255; ! delay_net_matrix[net] = Config.delay.net_restore; ! break; ! } ! } ! for(host = 0;; host++) { ! if (delay_hosts[net][host] == Host) ! break; ! if (delay_hosts[net][host] == 255) { ! delay_hosts[net][host] = Host; ! delay_hosts[net][host + 1] = 255; ! delay_host_matrix[(net << 8) + host] = Config.delay.host_restore; ! break; ! } ! } ! icpState->request->delay_matrix_pos = (net << 8) + host; ! } ! if(aclCheck(DelayChildAccessList, &ch)) { ! unsigned int host, Host; ! ! debug(12, 5, "icpProcessMISS: delay child set %s\n", inet_ntoa(ch.src_addr)); ! if(icpState->request->delay_matrix_pos != 65535) ! fatal("Delay and Child Delay set on same access!"); ! Host = ntohl(ch.src_addr.s_addr) & 0xff; ! for(host = 0;; host++) { ! if (delay_child_hosts[host] == Host) ! break; ! if (delay_child_hosts[host] == 255) { ! delay_child_hosts[host] = Host; ! delay_child_hosts[host + 1] = 255; ! delay_child_host_matrix[host] = Config.delay.child_host_restore; ! break; ! } ! } ! icpState->request->delay_child_pos = host; ! } ! requestUnlink(icpState->request); #endif return (protoDispatch(fd, url, icpState->entry, icpState->request)); } + #ifndef NO_LOG_UDP static void icpLogIcp(icpUdpData * queue) { *************** *** 983,988 **** --- 1036,1042 ---- #endif /* LOG_FULL_HEADERS */ NULL); /* content-type */ } + #endif int icpUdpReply(int fd, icpUdpData * queue) *************** *** 1014,1021 **** --- 1068,1077 ---- result = COMM_ERROR; } UdpQueueHead = queue->next; + #ifndef NO_LOG_UDP if (queue->logcode) icpLogIcp(queue); + #endif safe_free(queue->msg); safe_free(queue); } *************** *** 1111,1117 **** --- 1167,1175 ---- icpUdpSend(int fd, const struct sockaddr_in *to, icp_common_t * msg, + #ifndef NO_LOG_UDP log_type logcode, + #endif protocol_t proto) { icpUdpData *data = xcalloc(1, sizeof(icpUdpData)); *************** *** 1125,1131 **** --- 1183,1191 ---- #ifndef LESS_TIMING data->start = current_time; /* wrong for HIT_OBJ */ #endif + #ifndef NO_LOG_UDP data->logcode = logcode; + #endif data->proto = proto; AppendUdp(data); commSetSelect(fd, *************** *** 1158,1164 **** --- 1218,1226 ---- icpUdpSend(icpHitObjState->fd, &icpHitObjState->to, reply, + #ifndef NO_LOG_UDP LOG_UDP_HIT_OBJ, + #endif urlParseProtocol(entry->url)); } storeUnlockObject(entry); *************** *** 1230,1236 **** --- 1292,1302 ---- url = buf + sizeof(header) + sizeof(u_num32); if ((icp_request = urlParse(METHOD_GET, url)) == NULL) { reply = icpCreateMessage(ICP_OP_ERR, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, PROTO_NONE); + #else icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, PROTO_NONE); + #endif break; } checklist.src_addr = from.sin_addr; *************** *** 1241,1247 **** --- 1307,1317 ---- inet_ntoa(from.sin_addr), AclMatchedName); if (clientdbDeniedPercent(from.sin_addr) < 95) { reply = icpCreateMessage(ICP_OP_DENIED, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_DENIED, icp_request->protocol); + #endif } break; } *************** *** 1271,1290 **** --- 1341,1376 ---- safe_free(icpHitObjState); } else { reply = icpCreateMessage(ICP_OP_HIT, flags, url, header.reqnum, src_rtt); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_HIT, icp_request->protocol); + #endif break; } } /* if store is rebuilding, return a UDP_HIT, but not a MISS */ if (store_rebuilding == STORE_REBUILDING_FAST && opt_reload_hit_only) { reply = icpCreateMessage(ICP_OP_MISS_NOFETCH, flags, url, header.reqnum, src_rtt); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, icp_request->protocol); + #endif } else if (hit_only_mode_until > squid_curtime) { reply = icpCreateMessage(ICP_OP_MISS_NOFETCH, flags, url, header.reqnum, src_rtt); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, icp_request->protocol); + #endif } else { reply = icpCreateMessage(ICP_OP_MISS, flags, url, header.reqnum, src_rtt); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS, icp_request->protocol); + #endif } break; *************** *** 1381,1387 **** --- 1467,1477 ---- url = buf + sizeof(header) + sizeof(u_num32); if ((icp_request = urlParse(METHOD_GET, url)) == NULL) { reply = icpCreateMessage(ICP_OP_ERR, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, PROTO_NONE); + #else icpUdpSend(fd, &from, reply, LOG_UDP_INVALID, PROTO_NONE); + #endif break; } checklist.src_addr = from.sin_addr; *************** *** 1392,1398 **** --- 1482,1492 ---- inet_ntoa(from.sin_addr), AclMatchedName); if (clientdbDeniedPercent(from.sin_addr) < 95) { reply = icpCreateMessage(ICP_OP_DENIED, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_DENIED, icp_request->protocol); + #endif } break; } *************** *** 1402,1420 **** --- 1496,1530 ---- IcpOpcodeStr[header.opcode]); if (icpCheckUdpHit(entry, icp_request)) { reply = icpCreateMessage(ICP_OP_HIT, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_HIT, icp_request->protocol); + #endif break; } /* if store is rebuilding, return a UDP_HIT, but not a MISS */ if (opt_reload_hit_only && store_rebuilding == STORE_REBUILDING_FAST) { reply = icpCreateMessage(ICP_OP_MISS_NOFETCH, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, icp_request->protocol); + #endif } else if (hit_only_mode_until > squid_curtime) { reply = icpCreateMessage(ICP_OP_MISS_NOFETCH, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS_NOFETCH, icp_request->protocol); + #endif } else { reply = icpCreateMessage(ICP_OP_MISS, 0, url, header.reqnum, 0); + #ifdef NO_LOG_UDP + icpUdpSend(fd, &from, reply, icp_request->protocol); + #else icpUdpSend(fd, &from, reply, LOG_UDP_MISS, icp_request->protocol); + #endif } break; diff --context --recursive squid-1.1.15/src/icp.h squid-1.1.15.ucs.3/src/icp.h *** squid-1.1.15/src/icp.h Fri Jul 11 07:42:12 1997 --- squid-1.1.15.ucs.3/src/icp.h Thu Aug 14 17:07:19 1997 *************** *** 118,129 **** --- 118,131 ---- LOG_TCP_IMS_MISS, /* 8 */ LOG_TCP_SWAPIN_FAIL, /* 9 */ LOG_TCP_DENIED, /* 10 */ + #ifndef NO_LOG_UDP LOG_UDP_HIT, /* 11 */ LOG_UDP_HIT_OBJ, /* 12 */ LOG_UDP_MISS, /* 13 */ LOG_UDP_DENIED, /* 14 */ LOG_UDP_INVALID, /* 15 */ LOG_UDP_MISS_NOFETCH, /* 16 */ + #endif ERR_READ_TIMEOUT, /* 17 */ ERR_LIFETIME_EXP, /* 18 */ ERR_NO_CLIENTS_BIG_OBJ, /* 19 */ *************** *** 155,161 **** --- 157,165 ---- #ifndef LESS_TIMING struct timeval start; #endif + #ifndef NO_LOG_UDP log_type logcode; + #endif protocol_t proto; } icpUdpData; *************** *** 208,218 **** --- 212,229 ---- const char *url, int reqnum, int pad)); + #ifndef NO_LOG_UDP extern void icpUdpSend _PARAMS((int fd, const struct sockaddr_in *, icp_common_t * msg, log_type, protocol_t)); + #else + extern void icpUdpSend _PARAMS((int fd, + const struct sockaddr_in *, + icp_common_t * msg, + protocol_t)); + #endif extern void icpHandleUdp _PARAMS((int sock, void *data)); extern void asciiHandleConn _PARAMS((int sock, void *data)); extern void icpSendERROR _PARAMS((int fd, diff --context --recursive squid-1.1.15/src/neighbors.c squid-1.1.15.ucs.3/src/neighbors.c *** squid-1.1.15/src/neighbors.c Fri Jul 11 07:42:14 1997 --- squid-1.1.15.ucs.3/src/neighbors.c Tue Aug 19 18:15:33 1997 *************** *** 535,541 **** --- 535,543 ---- icpUdpSend(theOutIcpConnection, &e->in_addr, query, + #ifndef NO_LOG_UDP LOG_TAG_NONE, + #endif PROTO_NONE); } else { flags = 0; *************** *** 554,560 **** --- 556,564 ---- icpUdpSend(theOutIcpConnection, &e->in_addr, query, + #ifndef NO_LOG_UDP LOG_TAG_NONE, + #endif PROTO_NONE); } queries_sent++; *************** *** 600,606 **** --- 604,612 ---- icpUdpSend(theOutIcpConnection, &to_addr, query, + #ifndef NO_LOG_UDP LOG_TAG_NONE, + #endif PROTO_NONE); } } else { *************** *** 793,799 **** } } else if (opcode == ICP_OP_MISS) { if (e == NULL) { ! debug(15, 1, "Ignoring MISS from non-peer %s\n", inet_ntoa(from->sin_addr)); } else if (ntype != PEER_PARENT) { (void) 0; /* ignore MISS from non-parent */ --- 799,805 ---- } } else if (opcode == ICP_OP_MISS) { if (e == NULL) { ! debug(15, 2, "Ignoring MISS from non-peer %s\n", inet_ntoa(from->sin_addr)); } else if (ntype != PEER_PARENT) { (void) 0; /* ignore MISS from non-parent */ *************** *** 823,829 **** } } else if (opcode == ICP_OP_DENIED) { if (e == NULL) { ! debug(15, 1, "Ignoring DENIED from non-peer %s\n", inet_ntoa(from->sin_addr)); } else if (e->stats.pings_acked > 100) { if (100 * e->stats.counts[ICP_OP_DENIED] / e->stats.pings_acked > 95) { --- 829,835 ---- } } else if (opcode == ICP_OP_DENIED) { if (e == NULL) { ! debug(15, 2, "Ignoring DENIED from non-peer %s\n", inet_ntoa(from->sin_addr)); } else if (e->stats.pings_acked > 100) { if (100 * e->stats.counts[ICP_OP_DENIED] / e->stats.pings_acked > 95) { *************** *** 879,885 **** e->acls = NULL; e->icp_version = ICP_VERSION_CURRENT; e->type = parseNeighborType(type); ! e->tcp_up = 1; /* Append peer */ if (!Peers.peers_head) --- 885,891 ---- e->acls = NULL; e->icp_version = ICP_VERSION_CURRENT; e->type = parseNeighborType(type); ! e->tcp_up = 10; /* Append peer */ if (!Peers.peers_head) *************** *** 1125,1137 **** peerCheckConnectDone(int fd, int status, void *data) { peer *p = data; ! p->tcp_up = status == COMM_OK ? 1 : 0; ! if (p->tcp_up) { debug(15, 0, "TCP connection to %s/%d succeeded\n", p->host, p->http_port); } else { p->ck_conn_event_pend++; ! eventAdd("peerCheckConnect", peerCheckConnect, p, 80); } comm_close(fd); return; --- 1131,1144 ---- peerCheckConnectDone(int fd, int status, void *data) { peer *p = data; ! ! if (status == COMM_OK) { ! p->tcp_up = 10; debug(15, 0, "TCP connection to %s/%d succeeded\n", p->host, p->http_port); } else { p->ck_conn_event_pend++; ! eventAdd("peerCheckConnect", peerCheckConnect, p, 60); } comm_close(fd); return; *************** *** 1143,1152 **** if (!p->tcp_up) return; debug(15, 0, "TCP connection to %s/%d failed\n", p->host, p->http_port); ! p->tcp_up = 0; p->last_fail_time = squid_curtime; p->ck_conn_event_pend++; ! eventAdd("peerCheckConnect", peerCheckConnect, p, 80); } static void --- 1150,1161 ---- if (!p->tcp_up) return; debug(15, 0, "TCP connection to %s/%d failed\n", p->host, p->http_port); ! p->tcp_up--; ! if (p->tcp_up != 9) ! return; p->last_fail_time = squid_curtime; p->ck_conn_event_pend++; ! eventAdd("peerCheckConnect", peerCheckConnect, p, 30); } static void *************** *** 1185,1191 **** --- 1194,1202 ---- icpUdpSend(theOutIcpConnection, &p->in_addr, query, + #ifndef NO_LOG_UDP LOG_TAG_NONE, + #endif PROTO_NONE); mem->e_pings_n_pings = 255; fake->ping_status = PING_WAITING; diff --context --recursive squid-1.1.15/src/neighbors.h squid-1.1.15.ucs.3/src/neighbors.h *** squid-1.1.15/src/neighbors.h Fri Jun 6 13:45:11 1997 --- squid-1.1.15.ucs.3/src/neighbors.h Thu Aug 14 17:07:19 1997 *************** *** 162,167 **** --- 162,170 ---- #define NEIGHBOR_DEFAULT_PARENT 0x04 #define NEIGHBOR_ROUNDROBIN 0x08 #define NEIGHBOR_MCAST_RESPONDER 0x10 + #ifdef DELAY_HACK + #define NEIGHBOR_NO_DELAY 0x20 + #endif #define PEER_MAX_ADDRESSES 10 #define RTT_AV_FACTOR 1000 diff --context --recursive squid-1.1.15/src/objcache.c squid-1.1.15.ucs.3/src/objcache.c *** squid-1.1.15/src/objcache.c Wed Mar 26 15:29:52 1997 --- squid-1.1.15.ucs.3/src/objcache.c Thu Aug 14 17:07:19 1997 *************** *** 165,170 **** --- 165,174 ---- op = MGR_REDIRECTORS; else if (!strcmp(buf, "stats/io")) op = MGR_IO; + #ifdef DELAY_HACK + else if (!strcmp(buf, "stats/delay")) + op = MGR_DELAY; + #endif else if (!strcmp(buf, "stats/reply_headers")) op = MGR_REPLY_HDRS; else if (!strcmp(buf, "stats/filedescriptors")) *************** *** 292,297 **** --- 296,306 ---- case MGR_IO: HTTPCacheInfo->stat_get(HTTPCacheInfo, "io", entry); break; + #ifdef DELAY_HACK + case MGR_DELAY: + HTTPCacheInfo->stat_get(HTTPCacheInfo, "delay", entry); + break; + #endif case MGR_REPLY_HDRS: HTTPCacheInfo->stat_get(HTTPCacheInfo, "reply_headers", entry); break; diff --context --recursive squid-1.1.15/src/objcache_opcodes.h squid-1.1.15.ucs.3/src/objcache_opcodes.h *** squid-1.1.15/src/objcache_opcodes.h Sat Dec 14 06:26:38 1996 --- squid-1.1.15.ucs.3/src/objcache_opcodes.h Thu Aug 14 17:07:19 1997 *************** *** 38,43 **** --- 38,46 ---- MGR_FQDNCACHE, MGR_INFO, MGR_IO, + #ifdef DELAY_HACK + MGR_DELAY, + #endif MGR_IPCACHE, MGR_LOG_CLEAR, MGR_LOG_DISABLE, *************** *** 68,73 **** --- 71,79 ---- "fqdncache", "info", "io", + #ifdef DELAY_HACK + "delay", + #endif "ipcache", "log/clear", "log/disable", diff --context --recursive squid-1.1.15/src/proto.c squid-1.1.15.ucs.3/src/proto.c *** squid-1.1.15/src/proto.c Fri Aug 8 00:13:10 1997 --- squid-1.1.15.ucs.3/src/proto.c Thu Aug 14 17:07:19 1997 *************** *** 151,160 **** "ICP_END" }; - #if DELAY_HACK - extern int _delay_fetch; - #endif - static void protoDataFree(int fdunused, protodispatch_data * protoData) { --- 151,156 ---- *************** *** 267,276 **** (PF) getFromDefaultSource, (void *) entry, Config.neighborTimeout); - #ifdef DELAY_HACK - if (protoData->delay_fetch && entry->mem_obj) - entry->mem_obj->e_pings_n_pings++; - #endif return; } if ((e = protoData->default_parent)) { --- 263,268 ---- *************** *** 340,348 **** protoData->single_parent = getSingleParent(request); protoData->default_parent = getDefaultParent(request); protoData->n_peers = neighborsCount(request); - #ifdef DELAY_HACK - protoData->delay_fetch = _delay_fetch; - #endif debug(17, 2, "protoDispatch: inside_firewall = %d (%s)\n", protoData->inside_firewall, --- 332,337 ---- diff --context --recursive squid-1.1.15/src/proto.h squid-1.1.15.ucs.3/src/proto.h *** squid-1.1.15/src/proto.h Fri Apr 25 03:14:04 1997 --- squid-1.1.15.ucs.3/src/proto.h Thu Aug 14 17:07:23 1997 *************** *** 287,295 **** int n_peers; struct _peer *single_parent; struct _peer *default_parent; - #if DELAY_HACK - int delay_fetch; - #endif int ip_lookup_pending; } protodispatch_data; --- 287,292 ---- diff --context --recursive squid-1.1.15/src/squid.conf.pre.in squid-1.1.15.ucs.3/src/squid.conf.pre.in *** squid-1.1.15/src/squid.conf.pre.in Fri Aug 8 04:38:02 1997 --- squid-1.1.15.ucs.3/src/squid.conf.pre.in Thu Mar 26 18:07:52 1998 *************** *** 104,109 **** --- 104,110 ---- # weight=n # ttl=n # no-query + # no-delay # default # round-robin # multicast-responder *************** *** 125,130 **** --- 126,134 ---- # use 'no-query' to NOT send ICP queries to this # neighbor. # + # use 'no-delay' to prevent access to this neighbor infuencing + # the delay pools. + # # use 'default' if this is a parent cache which can # be used as a "last-resort." You should probably # only use 'default' in situations where you cannot *************** *** 834,839 **** --- 838,905 ---- # to fetch MISSES from us. # miss_access allow all + + # TAG: delay_access + # + # Set this for hosts to be in the unified and per-host delay pools. + delay_access deny all + + # TAG: delay_child_access + # + # Set this for hosts to use the child delay pool. This removes + # them from the unified or per-host delay pools if they were in them. + delay_child_access deny all + + # TAG: delay_max + # + # The maximum bytes in the unified delay pool. + #delay_max 102400 + + # TAG: delay_restore + # + # The bytes per second added to the unified delay pool. + #delay_restore 3584 + + # TAG: delay_host_max + # + # The maximum bytes per host in the per-host delay pool. + #delay_host_max 10240 + + # TAG: delay_host_restore + # + # The bytes per second added to each host in the unified delay pool. + #delay_host_restore 384 + + # TAG: delay_net_max + # + # The maximum bytes per net in the per-net delay pool. + #delay_net_max 32768 + + # TAG: delay_net_restore + # + # The bytes per second added to each net in the unified delay pool. + #delay_net_restore 1024 + + # TAG: delay_child_max + # + # The maximum bytes in the child delay pool. + #delay_child_max 204800 + + # TAG: delay_child_restore + # + # The bytes per second added to the child delay pool. + #delay_child_restore 8192 + + # TAG: delay_child_host_max + # + # The maximum bytes in the child delay pool for individual childred. + #delay_child_host_max 32768 + + # TAG: delay_child_host_restore + # + # The bytes per second added to the child delay pool for individual + # children. + #delay_child_host_restore 1024 # TAG: cache_host_acl # Just like 'cache_host_domain' but provides more flexibility by diff --context --recursive squid-1.1.15/src/stat.c squid-1.1.15.ucs.3/src/stat.c *** squid-1.1.15/src/stat.c Sun Jul 13 23:51:03 1997 --- squid-1.1.15.ucs.3/src/stat.c Tue Mar 31 13:58:43 1998 *************** *** 293,298 **** --- 293,323 ---- storeAppendPrintf(sentry, close_bracket); } + #ifdef DELAY_HACK + void stat_delay_get(sentry) + StoreEntry *sentry; + { + int i, j; + + storeAppendPrintf(sentry, open_bracket); + storeAppendPrintf(sentry, "{Delay Statistics}\n"); + storeAppendPrintf(sentry, "{unified delay pool: %d}\n", delay_data.bytes); + storeAppendPrintf(sentry, "{children delay pool: %d}\n", delay_data.child_bytes); + storeAppendPrintf(sentry, "{}\n"); + for (i = 0; delay_nets[i] != 255; i++) { + storeAppendPrintf(sentry, "{Network %d: Combined %d", delay_nets[i], delay_net_matrix[i]); + for (j = 0; delay_hosts[i][j] != 255; j++) + storeAppendPrintf(sentry, " %d: %d", delay_hosts[i][j], delay_host_matrix[(i<<8)+j]); + storeAppendPrintf(sentry, "}\n"); + } + storeAppendPrintf(sentry, "{}\n"); + for (i = 0; delay_child_hosts[i] != 255; i++) { + storeAppendPrintf(sentry, "{Child Host %d: %d}\n", delay_child_hosts[i], delay_child_host_matrix[i]); + } + storeAppendPrintf(sentry, close_bracket); + } + #endif + /* return total bytes of all registered and known objects. * may not reflect the retrieving object.... *************** *** 428,433 **** --- 453,462 ---- stat_utilization_get(ICPCacheInfo, sentry, "ICP"); } else if (strcmp(req, "io") == 0) { stat_io_get(sentry); + #ifdef DELAY_HACK + } else if (strcmp(req, "delay") == 0) { + stat_delay_get(sentry); + #endif } else if (strcmp(req, "reply_headers") == 0) { httpReplyHeaderStats(sentry); } else if (strcmp(req, "filedescriptors") == 0) { *************** *** 1303,1310 **** --- 1332,1341 ---- case LOG_TCP_IMS_HIT: case LOG_TCP_REFRESH_HIT: case LOG_TCP_REFRESH_FAIL_HIT: + #ifndef NO_LOG_UDP case LOG_UDP_HIT: case LOG_UDP_HIT_OBJ: + #endif obj->proto_stat_data[proto_id].hit++; break; default: diff --context --recursive squid-1.1.15/src/url.h squid-1.1.15.ucs.3/src/url.h *** squid-1.1.15/src/url.h Fri Aug 8 04:40:06 1997 --- squid-1.1.15.ucs.3/src/url.h Tue Mar 31 17:40:55 1998 *************** *** 73,78 **** --- 73,82 ---- int imslen; int max_forwards; struct in_addr client_addr; + #ifdef DELAY_HACK + unsigned int delay_matrix_pos; + char delay_child_pos; + #endif }; extern char *url_convert_hex _PARAMS((char *org_url, int allocate));