Index: squid/src/cf.data.pre diff -c squid/src/cf.data.pre:1.245.2.74 squid/src/cf.data.pre:1.245.2.75 *** squid/src/cf.data.pre:1.245.2.74 Sat Sep 25 15:03:49 2004 --- squid/src/cf.data.pre Mon Sep 27 12:17:38 2004 *************** *** 3850,3855 **** --- 3850,3868 ---- after 10 seconds timeout. DOC_END + NAME: balance_on_multiple_ip + TYPE: onoff + LOC: Config.onoff.balance_on_multiple_ip + DEFAULT: on + DOC_START + Some load balancing servers based on round robin DNS have been + found not to preserve user session state across requests + to different IP addresses. + + By default Squid rotates IP's per request. By disabling + this directive only connection failure trigers rotation. + DOC_END + NAME: pipeline_prefetch TYPE: onoff LOC: Config.onoff.pipeline_prefetch Index: squid/src/client_side.c diff -c squid/src/client_side.c:1.561.2.58 squid/src/client_side.c:1.561.2.59 *** squid/src/client_side.c:1.561.2.58 Sat Jul 17 10:15:31 2004 --- squid/src/client_side.c Mon Sep 27 12:17:38 2004 *************** *** 2325,2337 **** e = http->entry = storeGetPublicByRequest(r); else e = http->entry = NULL; ! /* Release negatively cached IP-cache entries on reload */ ! if (r->flags.nocache) ipcacheInvalidate(r->host); #if HTTP_VIOLATIONS ! else if (r->flags.nocache_hack) ipcacheInvalidate(r->host); ! #endif #if USE_CACHE_DIGESTS http->lookup_type = e ? "HIT" : "MISS"; #endif --- 2325,2347 ---- e = http->entry = storeGetPublicByRequest(r); else e = http->entry = NULL; ! /* Release IP-cache entries on reload */ ! if (r->flags.nocache) { ! #if USE_DNSSERVERS ipcacheInvalidate(r->host); + #else + ipcacheInvalidateNegative(r->host); + #endif /* USE_DNSSERVERS */ + } #if HTTP_VIOLATIONS ! else if (r->flags.nocache_hack) { ! #if USE_DNSSERVERS ipcacheInvalidate(r->host); ! #else ! ipcacheInvalidateNegative(r->host); ! #endif /* USE_DNSSERVERS */ ! } ! #endif /* HTTP_VIOLATIONS */ #if USE_CACHE_DIGESTS http->lookup_type = e ? "HIT" : "MISS"; #endif Index: squid/src/comm.c diff -c squid/src/comm.c:1.324.2.3 squid/src/comm.c:1.324.2.4 *** squid/src/comm.c:1.324.2.3 Sat Nov 29 11:52:59 2003 --- squid/src/comm.c Mon Sep 27 12:17:39 2004 *************** *** 290,296 **** } assert(ia->cur < ia->count); cs->in_addr = ia->in_addrs[ia->cur]; ! ipcacheCycleAddr(cs->host, NULL); cs->addrcount = ia->count; cs->connstart = squid_curtime; commConnectHandle(cs->fd, cs); --- 290,297 ---- } assert(ia->cur < ia->count); cs->in_addr = ia->in_addrs[ia->cur]; ! if (Config.onoff.balance_on_multiple_ip) ! ipcacheCycleAddr(cs->host, NULL); cs->addrcount = ia->count; cs->connstart = squid_curtime; commConnectHandle(cs->fd, cs); Index: squid/src/ipcache.c diff -c squid/src/ipcache.c:1.236.2.3 squid/src/ipcache.c:1.236.2.4 *** squid/src/ipcache.c:1.236.2.3 Thu Feb 12 02:32:09 2004 --- squid/src/ipcache.c Mon Sep 27 12:17:39 2004 *************** *** 116,121 **** --- 116,122 ---- static void ipcacheRelease(ipcache_entry * i) { + debug(14, 3) ("ipcacheRelease: Releasing entry for '%s'\n", (const char *) i->hash.key); hash_remove_link(ip_table, (hash_link *) i); dlinkDelete(&i->lru, &lru_list); ipcacheFreeEntry(i); *************** *** 332,338 **** return i; } assert(answers); ! for (j = 0, k = 0; k < nr; k++) { if (answers[k].type != RFC1035_TYPE_A) continue; if (answers[k].class != RFC1035_CLASS_IN) --- 333,339 ---- return i; } assert(answers); ! for (k = 0; k < nr; k++) { if (answers[k].type != RFC1035_TYPE_A) continue; if (answers[k].class != RFC1035_CLASS_IN) *************** *** 582,587 **** --- 583,602 ---- */ } + void + ipcacheInvalidateNegative(const char *name) + { + ipcache_entry *i; + if ((i = ipcache_get(name)) == NULL) + return; + if (i->flags.negcached) + i->expires = squid_curtime; + /* + * NOTE, don't call ipcacheRelease here becuase we might be here due + * to a thread started from a callback. + */ + } + ipcache_addrs * ipcacheCheckNumeric(const char *name) { *************** *** 669,674 **** --- 684,690 ---- if (!ia->bad_mask[k]) { ia->bad_mask[k] = TRUE; ia->badcount++; + i->expires = XMIN(squid_curtime + XMAX(60, Config.negativeDnsTtl), i->expires); debug(14, 2) ("ipcacheMarkBadAddr: %s [%s]\n", name, inet_ntoa(addr)); } ipcacheCycleAddr(name, ia); Index: squid/src/protos.h diff -c squid/src/protos.h:1.420.2.22 squid/src/protos.h:1.420.2.23 *** squid/src/protos.h:1.420.2.22 Wed Feb 4 10:42:28 2004 --- squid/src/protos.h Mon Sep 27 12:17:39 2004 *************** *** 585,594 **** extern EVH ipcache_purgelru; extern const ipcache_addrs *ipcache_gethostbyname(const char *, int flags); extern void ipcacheInvalidate(const char *); ! extern void ipcacheReleaseInvalid(const char *); extern void ipcache_init(void); extern void stat_ipcache_get(StoreEntry *); - extern int ipcacheQueueDrain(void); extern void ipcacheCycleAddr(const char *name, ipcache_addrs *); extern void ipcacheMarkBadAddr(const char *name, struct in_addr); extern void ipcacheMarkGoodAddr(const char *name, struct in_addr); --- 585,593 ---- extern EVH ipcache_purgelru; extern const ipcache_addrs *ipcache_gethostbyname(const char *, int flags); extern void ipcacheInvalidate(const char *); ! extern void ipcacheInvalidateNegative(const char *); extern void ipcache_init(void); extern void stat_ipcache_get(StoreEntry *); extern void ipcacheCycleAddr(const char *name, ipcache_addrs *); extern void ipcacheMarkBadAddr(const char *name, struct in_addr); extern void ipcacheMarkGoodAddr(const char *name, struct in_addr); Index: squid/src/structs.h diff -c squid/src/structs.h:1.408.2.26 squid/src/structs.h:1.408.2.27 *** squid/src/structs.h:1.408.2.26 Sat Sep 25 05:56:16 2004 --- squid/src/structs.h Mon Sep 27 12:17:39 2004 *************** *** 604,609 **** --- 604,610 ---- int pipeline_prefetch; int request_entities; int detect_broken_server_pconns; + int balance_on_multiple_ip; } onoff; acl *aclList; struct {

AltStyle によって変換されたページ (->オリジナル) /