diff -rupN squid-2.5.STABLE3/ChangeLog squid-2.5.STABLE4/ChangeLog --- squid-2.5.STABLE3/ChangeLog Sun May 25 07:03:25 2003 +++ squid-2.5.STABLE4/ChangeLog Sun Sep 14 17:44:48 2003 @@ -1,3 +1,77 @@ +Changes to squid-2.5.STABLE4 (15 Sep 2003): + - Lithuanian error messages added to the distribution + - Bug #660: segfauld if more than one custom deny_info line + - cache_dir disd documentation cleanup + - check open of /dev/null to avoid 100% CPU loop in badly + configured chroot environments + - documentation update on uri_whitespace to refer to the correct RFC + - Bug #655: icmpRecv: recv: (11) Resource temporarily unavailable + - Bug #683: external_acl does not wait for ident lookups to complete + - aufs: Fix a minor use-after-free problem which could cause the + count of opening filedescriptors to grow larger than it should + - Syntax changes to make GCC-3.3 accept Squid without complaints + - Warning if CARP server defined in incorrect load factor order + - neighbor_type_domain documentation update + - http_header_access now works when using cache peers + - high_memory_warning now uses sbrk as fallback mechanism on + platforms where neither mallinfo or mstats are available. + - hosts_file now handles comments at the end of lines correcly + - storeCheckCachable() Stats corrected for release_request and + wrong_content_length. + - cachePeerPingsSent MIB type corrected + - unused minimum_retry_timeout directive removed + - Bug #702: ERR_TO_BIG spanish translation + - Bug #705: Memory leak on deny_info TCP_RESET + - Code cleanup to fix compile error in httpHeaderDelById + - Bug #699: Host header now forwarded exactly where it was in the + original request to work around certain broken firewalls or + load balancers which fail if this header is too far into the + request headers. + - Bug #704: Memory leak on reply_body_max_size + - Bug #686: requests denied due to http_reply_access are now + logged with TCP_DENIED (instead of TCP_MISS, etc). + - Bug #708: ie_refresh now sends no-cache to have the reload + request propagate properly in cache meshes + - Bug #700: Crashes related to ftpTimeout: timeout in SENT_PASV state + - Bug #709: cbdata.c:186: "c->valid" assertion due to peer + digest not found + - Bug #710: round-robin cache_dir selection incorrectly + compares max-size. + - Statistics corrections in HTTP header statitics + - QUICKSTART cleanups + - Bug #715: statCounter.syscalls.disk counters treated + inconsistently. Now increment the counters in AUFS + functions and for unlinkd. + - Improvements to the (experimental) COSS storage scheme. + - Bug #721: User name field in access.log sometimes blank + - Bug #94: assertion failed: http.c: "-1 == cfd || + FD_SOCKET == fd_table[cfd].type" + - Bug #716: assertion failed: client_side.c:1478: "size > 0" + - Bug #732: aufs calculates number of threads and limits wrongly + - Bug #663: Username not logged into access.log in case of /407 + - Bug #267: Form POSTing troubles with NTLM authentication + and occationally in differen other error conditions. + - Bug #736: ICP dynamic timeout algorithm ignores multicast. + - Bug #733: No explicit error message when ncsa_auth can't access + passwd file + - Bug #267, #757: POST with NTLM stops after persistent connection + timeout + - Bug #742: Wrong status code on access denials if delay_access + is used. Most notably 407 instead of 403 could be returned. + - Bug #763: segfault if using ntlm in http_reply_access + - Bug #638: assertion error if using proxy_auth in delay_access + - Bug #756: segmentation fault if using ntlm proxy_auth in delay_access + - The issue of reply_body_max_size limiting the size of error + messages no longer applies. + - external_acl_type concurrency= option renamed to children= to + prepare for Squid-3 upgrades. Old syntax still accepted for the + duration of the Squid-2.5 release. + - number of filedescriptors rounded down to an even multiple of 64 + to work around issues in certain libc implementations. + - winbind helpers less noisy in cache.log on restarts/shutdown. + - Squid now automatically restarts helpers if too many of them + have crashed. + Changes to squid-2.5.STABLE3 (25 May 2003): - Bug #573: Occational false negatives in external acl lookups diff -rupN squid-2.5.STABLE3/QUICKSTART squid-2.5.STABLE4/QUICKSTART --- squid-2.5.STABLE3/QUICKSTART Sun Aug 18 05:42:50 2002 +++ squid-2.5.STABLE4/QUICKSTART Fri Jul 18 02:53:27 2003 @@ -1,7 +1,7 @@ Squid QUICKSTART -$Id: QUICKSTART,v 1.4.2.2 2002/08/18 11:42:50 robertc Exp $ +$Id: QUICKSTART,v 1.4.2.4 2003/07/18 08:53:27 hno Exp $ This document is intended only for people who want to get Squid running quickly It is not a substitute for the real documentation. Squid has @@ -19,24 +19,19 @@ Uncomment and edit the following lines i ============================================================================== -cache_peer +cache_peer, never_direct/always_direct If you have a parent cache, put it here. The administrators of the parent cache typically provided you with instructions. You should - always ask permission before adding a parent cache. - -cache_mem - - Add here the amount of memory (RAM memory) to devote to caching. - Warning: Squid uses much more than this value. Rule of thumb: if - you have N megabytes free for Squid, put N/3 here. + always ask permission before adding a parent cache. See also the + never_direct/always_direct directives. cache_dir /usr/local/squid/var/cache 100 16 256 Add here (first number, here 100) the amount of hard disk space (in megabytes) to devote to caching. -acl, http_access, icp_access, miss_access +acl, http_access, icp_access Access control lists. This is important because it prevents people from stealing your network resources. To fill in the @@ -55,9 +50,6 @@ acl, http_access, icp_access, miss_acces icp_access allow allowed_hosts icp_access deny all - miss_access allow allowed_hosts - miss_access deny all - cache_mgr Put here the e-mail address of the manager: @@ -81,8 +73,7 @@ line TWICE: % /usr/local/squid/sbin/squid Check in the cache.log (/usr/local/squid/var/logs/cache.log) that -everything is all right. Note that "WARNING: Cannot write to swap -directory" is normal the first time you run Squid. +everything is all right. Once Squid created all its files (it can take several minutes on some systems), test it with echoping or a regular Web client. By default, diff -rupN squid-2.5.STABLE3/RELEASENOTES.html squid-2.5.STABLE4/RELEASENOTES.html --- squid-2.5.STABLE3/RELEASENOTES.html Sun May 25 07:06:38 2003 +++ squid-2.5.STABLE4/RELEASENOTES.html Sun Sep 14 18:37:43 2003 @@ -1,13 +1,13 @@ - + Squid 2.5 release notes

Squid 2.5 release notes

-

Squid Developers

$Id: release-2.5.html,v 1.1.2.11 2003/05/19 09:03:57 hno Exp $ +

Squid Developers

$Id: release-2.5.html,v 1.1.2.20 2003/09/15 00:35:55 hno Exp $
This document contains the release notes for version 2.5 of Squid. Squid is a WWW Cache application developed by the National Laboratory @@ -129,18 +129,21 @@ exacly where you want to have them in yo
sleep_after_fork

Give the OS a small amount of time to accomodate the fork+exec used to launch helpers - if squid has a lot of virtual memory allocated the OS may run out of virtual memory during helper spawning otherwise.

reference_age

This has been removed - starting with Squid-2.4 this directive have had no effect and has now been fully removed to avoid confusion.

siteselect_timeout

This has been removed - it is not referenced anywhere in the source code.

+
minimum_retry_timeout

This has been removed - it is not referenced anywhere in the source code.

3. Known issues and limitations

-

There is a few limitations and issues in this version of Squid which we hope to correct in a later release

+

There is a few known issues and limitations in this version of Squid which we hope to correct in a later release

-
deny_info

deny_info only works for http_access, not for the acls listen in http_reply_access

-
Bug #616

Negative cached 404 replies with VARY header never matches

Bug #592

always/never_direct and NTLM authentication

Bug #585

cache_peer_access fails with NTLM authentication

+
deny_info

deny_info only works for http_access, not for the acls listen in http_reply_access

+ +
Bug #692

tcp_outgoing_address using an ident ACL does not work

+
Bug #616

Negative cached 404 replies with VARY header never matches

Bug #581

acl max_user_ip and multiple authentication schemes

Bug #513

squid -F is starting server sockets to early

Bug #518

wb_auth fails on TRU64 and probably other 64 bit platforms

@@ -149,7 +152,6 @@ exacly where you want to have them in yo
Bug #426

Vary: * does not work

Bug #410

unstable if runs out of disk space

Bug #355

diskd may appear slow on low loads

-
Bug #267

Form POSTing troubles with NTLM authentication

@@ -180,9 +182,43 @@ helpers should be built for if different

5. Key changes squid-2.5.STABLE2 to 2.5.STABLE3:

-

Squid-2.5.STABLE3 is a bugfix release. See the list of +

+

+

+ +

6. Key changes squid-2.5.STABLE3 to 2.5.STABLE4:

+ +

+

+

diff -rupN squid-2.5.STABLE3/configure squid-2.5.STABLE4/configure --- squid-2.5.STABLE3/configure Sun May 25 07:04:25 2003 +++ squid-2.5.STABLE4/configure Sun Sep 14 18:37:04 2003 @@ -1000,7 +1000,7 @@ fi # Define the identity of the package. PACKAGE=squid -VERSION=2.5.STABLE3 +VERSION=2.5.STABLE4 cat >> confdefs.h <&6 echo "configure:1057: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. @@ -7878,7 +7878,7 @@ main() { i++; #endif /* IF !DEF CYGWIN */ fp = fopen("conftestval", "w"); - fprintf (fp, "%d\n", i); + fprintf (fp, "%d\n", i & ~0x3F); exit(0); } diff -rupN squid-2.5.STABLE3/configure.in squid-2.5.STABLE4/configure.in --- squid-2.5.STABLE3/configure.in Sun May 25 07:04:25 2003 +++ squid-2.5.STABLE4/configure.in Sun Sep 14 18:37:04 2003 @@ -3,15 +3,15 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.251.2.48 2003/05/25 12:56:47 hno Exp $ +dnl $Id: configure.in,v 1.251.2.50 2003/09/14 23:44:48 hno Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_AUX_DIR(cfgaux) -AM_INIT_AUTOMAKE(squid, 2.5.STABLE3) +AM_INIT_AUTOMAKE(squid, 2.5.STABLE4) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.251.2.48 $)dnl +AC_REVISION($Revision: 1.251.2.50 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1943,7 +1943,7 @@ main() { i++; #endif /* IF !DEF CYGWIN */ fp = fopen("conftestval", "w"); - fprintf (fp, "%d\n", i); + fprintf (fp, "%d\n", i & ~0x3F); exit(0); } ], diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_ACCESS_DENIED squid-2.5.STABLE4/errors/Lithuanian/ERR_ACCESS_DENIED --- squid-2.5.STABLE3/errors/Lithuanian/ERR_ACCESS_DENIED Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_ACCESS_DENIED Tue Aug 13 06:33:41 2002 @@ -0,0 +1,24 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Priėjimas draudžiamas. + +

    +Priėjimo kontrolės konfiguracija šiuo metu neleidžia atsiųsti jūsų +nurodyto puslapio. Jei manote, kad tai yra neteisinga, galite susisiekti +su jūsų Interneto paslaugų tiekėju. +

+

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_CACHE_ACCESS_DENIED squid-2.5.STABLE4/errors/Lithuanian/ERR_CACHE_ACCESS_DENIED --- squid-2.5.STABLE3/errors/Lithuanian/ERR_CACHE_ACCESS_DENIED Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_CACHE_ACCESS_DENIED Tue Aug 13 06:33:41 2002 @@ -0,0 +1,34 @@ + + +KLAIDA: Priėjimas prie kešo uždraustas + + + +

KLAIDA

+

Priėjimas prie kešo uždraustas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Priėjimas prie kešo uždraustas. + +
+

+ +

Atsiprašau, bet jūs šiuo metu negalite vykdyti užklausimo: +

    %U
+per šį serverį, kol jūs neprisistatysite. +

+ +

+Jums reikia Netscape v2.0 ar naujesnio, arba Microsoft Internet +Explorer 3.0 ar naujesnio, arba kitos HTTP/1.1 suprantančios peržiūros +programos. Prašau susisiekti su proxy +administratoriumi, jei jums kils sunkumai prisistatant arba +pakeisti savo slaptažodį. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_CACHE_MGR_ACCESS_DENIED squid-2.5.STABLE4/errors/Lithuanian/ERR_CACHE_MGR_ACCESS_DENIED --- squid-2.5.STABLE3/errors/Lithuanian/ERR_CACHE_MGR_ACCESS_DENIED Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_CACHE_MGR_ACCESS_DENIED Tue Aug 13 06:33:41 2002 @@ -0,0 +1,36 @@ + + +KLAIDA: Kešo menedžerio priėjimas uždraustas + + + +

KLAIDA

+

Kešo menedžerio priėjimas uždraustas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Kešo menedžerio priėjimas uždraustas. + +
+

+ +

Atsiprašiau, bet jūs negalite vykdyti užklausimo: +

    %U
+šiam kešo menedžeriui, kol jūs neprisistatysite. +

+ +

+Jums reikia Netscape v2.0 ar naujesnio, arba Microsoft Internet +Explorer 3.0 ar naujesnio, arba kitos HTTP/1.1 suprantančios peržiūros +programos. Prašau susisiekti su administratoriumi, +jei jums iškilo problemos prisistatant arba, jei jūs esate +administratorius, perskaitykite Squid documentaciją dėl kešo menedžerio +interfeiso ir patikrinkite kešo žurnalą dėl detalesnių pranešimų apie +klaidas. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_CANNOT_FORWARD squid-2.5.STABLE4/errors/Lithuanian/ERR_CANNOT_FORWARD --- squid-2.5.STABLE3/errors/Lithuanian/ERR_CANNOT_FORWARD Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_CANNOT_FORWARD Tue Aug 13 06:33:41 2002 @@ -0,0 +1,29 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Šiuo metu negaliu persiųsti užklausimo. + +
+ +

+Užklausimas negali būti persiųstas į pagrindinį serverį arba kurį nors +pagalbinį proxy serverį. Pagrindinės tokios klaidos priežastys yra šios: +

    +
  • Proxy administratorius neleidžia serveriui kurti tiesioginių + susijungimų su serveriais, ir +
  • Visi pagalbiniai proxy serveriai šiuo metu yra nepasiekiami. +
+

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_CONNECT_FAIL squid-2.5.STABLE4/errors/Lithuanian/ERR_CONNECT_FAIL --- squid-2.5.STABLE3/errors/Lithuanian/ERR_CONNECT_FAIL Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_CONNECT_FAIL Tue Aug 13 06:33:41 2002 @@ -0,0 +1,28 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Ryšys neveikia + +
+ +

+Sistema atsakė: +

    %E
+ +

+Nurodytas serveris arba tinklas yra atjungtas. +Pabandykite vykdyti užklausimą vėliau. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_DNS_FAIL squid-2.5.STABLE4/errors/Lithuanian/ERR_DNS_FAIL --- squid-2.5.STABLE3/errors/Lithuanian/ERR_DNS_FAIL Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_DNS_FAIL Tue Aug 13 06:33:41 2002 @@ -0,0 +1,33 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
    +Neįmanoma nustatyti %H serverio IP adreso +
    +
+ +

+DNS serveris atsakė: +

+%z +
+ +

+Tai reiškia, kad: +

+ Neįmanoma aptikti serverio nurodytu adresu. 
+ Patikrinkite, ar teisingai įvedėte adresą. 
+
+

+ diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_FORWARDING_DENIED squid-2.5.STABLE4/errors/Lithuanian/ERR_FORWARDING_DENIED --- squid-2.5.STABLE3/errors/Lithuanian/ERR_FORWARDING_DENIED Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_FORWARDING_DENIED Tue Aug 13 06:33:41 2002 @@ -0,0 +1,25 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Pervedimo komanda neleistina. + +
+ +

+Šis kešas negali perkelti jūsų užklausimo, kadangi jis bando sukurti +sibling tipo ryšius. Gal būt klientas %i yra kešas, kuris klaidingai +sukonfiguruotas. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_DISABLED squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_DISABLED --- squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_DISABLED Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_DISABLED Tue Aug 13 06:33:41 2002 @@ -0,0 +1,23 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +FTP yra atjungtas + +
+ +

+Šis proxy serveris nepalaiko FTP. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_FAILURE squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_FAILURE --- squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_FAILURE Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_FAILURE Tue Aug 13 06:33:41 2002 @@ -0,0 +1,24 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Įvyko FTP protokolo klaida +bandant atsiusti puslapį: +%U +

+Squid nusiuntė šią FTP komandą: +

%f
+ir gavo šį atsakymą: +
%F
+
%g
+

+Tai gali būti sąlygota FTP adreso su pilnu keliu (kuris neatitinka +RFC 1738 standarto). Jei taip atsitiko, tada duomenys gali būti +rasti %B adresu. +

+ diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_PUT_CREATED squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_PUT_CREATED --- squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_PUT_CREATED Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_PUT_CREATED Tue Aug 13 06:33:41 2002 @@ -0,0 +1,11 @@ + + +FTP PUT operacija buvo sėkminga: Failas sukurtas + + +

Operacija buvo sėkminga

+

Failas sukurtas

+
+

+

+ diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_PUT_ERROR squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_PUT_ERROR --- squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_PUT_ERROR Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_PUT_ERROR Tue Aug 13 06:33:41 2002 @@ -0,0 +1,27 @@ + + +KLAIDA: FTP uploadas nepavyko + + +

KLAIDA

+

FTP PUT/uploadas nepavyko

+
+

+Bandydamas pakrauti dokumentą: +%U +

+Squid nusiuntė šią FTP komandą: +


+        %f
+
+ir gavo tokį atsakymą: +

+        %F
+
+

+Tai reiškia: +

+Patikrinkite kelią, teises, disko talpą ir pabandykite dar kartą.
+
+

+ diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_PUT_MODIFIED squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_PUT_MODIFIED --- squid-2.5.STABLE3/errors/Lithuanian/ERR_FTP_PUT_MODIFIED Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_FTP_PUT_MODIFIED Tue Aug 13 06:33:41 2002 @@ -0,0 +1,11 @@ + + +FTP PUT operacija sėkminga: Failas atnaujintas + + +

Operacija sėkminga

+

Failas atnaujintas

+
+

+

+ diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_INVALID_REQ squid-2.5.STABLE4/errors/Lithuanian/ERR_INVALID_REQ --- squid-2.5.STABLE3/errors/Lithuanian/ERR_INVALID_REQ Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_INVALID_REQ Tue Aug 13 06:33:41 2002 @@ -0,0 +1,33 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant įvykdyti užklausimą: +

+%R
+
+

+Gautas klaidos pranešimas: +

    +
  • + +Neteisingas užklausimas + +
+ +

+Dalis HTTP užklausimo yra klaidinga. Galimos problemos: +

    +
  • Trūksta arba nežinomas užklausimo metodas +
  • Trūksta adresas +
  • Trūksta HTTP identifikatoriaus (HTTP/1.0) +
  • Užklausimas per didelis +
  • Trūksta Content-Length parametro POST arba PUT užklausime +
  • Neleistinas simbolis serverio varde; underscore simboliai yra neleistini +
+

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_INVALID_URL squid-2.5.STABLE4/errors/Lithuanian/ERR_INVALID_URL --- squid-2.5.STABLE3/errors/Lithuanian/ERR_INVALID_URL Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_INVALID_URL Tue Aug 13 06:33:41 2002 @@ -0,0 +1,29 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Klaidingas adresas + +
+ +

+Kažkuri adreso dalis yra klaidinga. Galimos šios problemos: +

    +
  • Trūksta arba klaidingas protokolas (turetų būti `http://' ar panašus) +
  • Trūksta serverio vardo +
  • Neleistinas double-escape kodas adrese +
  • Neleistinas simbolis serverio varde; underscores simboliai yra neleistini +
+

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_LIFETIME_EXP squid-2.5.STABLE4/errors/Lithuanian/ERR_LIFETIME_EXP --- squid-2.5.STABLE3/errors/Lithuanian/ERR_LIFETIME_EXP Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_LIFETIME_EXP Tue Aug 13 06:33:41 2002 @@ -0,0 +1,24 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Ryšio trukmės laiko pabaiga + +
+ +

+Squid nutraukė užklausimą, kadangi jis viršijo maksimalią +ryšio trukmės reikšmę. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_NO_RELAY squid-2.5.STABLE4/errors/Lithuanian/ERR_NO_RELAY --- squid-2.5.STABLE3/errors/Lithuanian/ERR_NO_RELAY Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_NO_RELAY Tue Aug 13 06:33:41 2002 @@ -0,0 +1,24 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Nėra Wais Relay + +
+ +

+WAIS Relay serveris yra nenurodytas šiame proxy serveryje! +Šauk ant (tik ne į) admino. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_ONLY_IF_CACHED_MISS squid-2.5.STABLE4/errors/Lithuanian/ERR_ONLY_IF_CACHED_MISS --- squid-2.5.STABLE3/errors/Lithuanian/ERR_ONLY_IF_CACHED_MISS Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_ONLY_IF_CACHED_MISS Tue Aug 13 06:33:41 2002 @@ -0,0 +1,26 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Tinkamas dokumentas nerastas proxy serveryje ir only-if-cached +komanda buvo nurodyta. + +
+ +

+Jūs davėte užklausimą su only-if-cached proxy kontrolės +komanda. Dokumentas nerastas serveryje, arba jis pareikalavo +patvirtinimo uždrausto only-if-cached komandos. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_READ_ERROR squid-2.5.STABLE4/errors/Lithuanian/ERR_READ_ERROR --- squid-2.5.STABLE3/errors/Lithuanian/ERR_READ_ERROR Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_READ_ERROR Tue Aug 13 06:33:41 2002 @@ -0,0 +1,28 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Skaitymo klaida + +
+ +

+Sistema atsakė: +

    %E
+ +

+Įvyko klaida skaitant duomenis tinkle. +Prašau pakartoti savo užklausimą. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_READ_TIMEOUT squid-2.5.STABLE4/errors/Lithuanian/ERR_READ_TIMEOUT --- squid-2.5.STABLE3/errors/Lithuanian/ERR_READ_TIMEOUT Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_READ_TIMEOUT Tue Aug 13 06:33:41 2002 @@ -0,0 +1,28 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Leistino skaitymo laiko pabaiga + +
+ +

+Sistema atsakė: +

    %E
+ +

+Klaida įvyko laukiant duomenų atsiuntimo iš tinklo. Tinklas arba serveris +gali būti atjungtas arba perkrautas. Prašau pakartoti jūsų užklausimą. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_SOCKET_FAILURE squid-2.5.STABLE4/errors/Lithuanian/ERR_SOCKET_FAILURE --- squid-2.5.STABLE3/errors/Lithuanian/ERR_SOCKET_FAILURE Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_SOCKET_FAILURE Tue Aug 13 06:33:41 2002 @@ -0,0 +1,28 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Socket klaida + +
+ +

+Sistema atsakė: +

    %E
+ +

+Squid negalėjo sukurti TCP socket, greičiausiai dėl per didelio apkrovimo. +Prašau pakartoti savo užklausimą. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_UNSUP_REQ squid-2.5.STABLE4/errors/Lithuanian/ERR_UNSUP_REQ --- squid-2.5.STABLE3/errors/Lithuanian/ERR_UNSUP_REQ Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_UNSUP_REQ Tue Aug 13 06:33:41 2002 @@ -0,0 +1,25 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Nepalaikomas užklausos metodas ar protokolas + +
+ +

+Squid palaiko ne visus užklausos metodus daliai protokolų. +Pavyzdžiui, jūs negalite vykdyti POST Gopher tipo užklausime. +

+ diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_URN_RESOLVE squid-2.5.STABLE4/errors/Lithuanian/ERR_URN_RESOLVE --- squid-2.5.STABLE3/errors/Lithuanian/ERR_URN_RESOLVE Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_URN_RESOLVE Tue Aug 13 06:33:42 2002 @@ -0,0 +1,23 @@ + + +KLAIDA: Nurodytas URN negali būti atsiųstas + + +

KLAIDA

+

puslapis nurodytam URN negali būti atsiųstas

+
+

+Bandant atsiųsti URN: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Negaliu aptikti URN + +
+ +

+Mielieji, siūlau daug nesitikėti iš URNu %T :) +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_WRITE_ERROR squid-2.5.STABLE4/errors/Lithuanian/ERR_WRITE_ERROR --- squid-2.5.STABLE3/errors/Lithuanian/ERR_WRITE_ERROR Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_WRITE_ERROR Tue Aug 13 06:33:42 2002 @@ -0,0 +1,28 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Rašymo klaida + +
+ +

+Sistema atsakė: +

    %E
+ +

+Įvyko klaida bandant rašyti tinkle. +Prašau pakartoti savo užklausimą. +

diff -rupN squid-2.5.STABLE3/errors/Lithuanian/ERR_ZERO_SIZE_OBJECT squid-2.5.STABLE4/errors/Lithuanian/ERR_ZERO_SIZE_OBJECT --- squid-2.5.STABLE3/errors/Lithuanian/ERR_ZERO_SIZE_OBJECT Wed Dec 31 17:00:00 1969 +++ squid-2.5.STABLE4/errors/Lithuanian/ERR_ZERO_SIZE_OBJECT Tue Aug 13 06:33:42 2002 @@ -0,0 +1,23 @@ + + +KLAIDA: Puslapis nurodytu adresu negali būti atsiųstas + + +

KLAIDA

+

Puslapis nurodytu adresu negali būti atsiųstas

+
+

+Bandant atsiųsti puslapį: +%U +

+Gautas klaidos pranešimas: +

    +
  • + +Atsakymas nulinis + +
+ +

+Squid negavo jokių duomenų šiam užklausimui. +

diff -rupN squid-2.5.STABLE3/errors/Makefile.am squid-2.5.STABLE4/errors/Makefile.am --- squid-2.5.STABLE3/errors/Makefile.am Fri Oct 18 15:22:11 2002 +++ squid-2.5.STABLE4/errors/Makefile.am Sun May 25 07:47:45 2003 @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in # -# $Id: Makefile.am,v 1.5.2.4 2002/10/18 21:22:11 hno Exp $ +# $Id: Makefile.am,v 1.5.2.5 2003/05/25 13:47:45 hno Exp $ # errordir = $(datadir)/errors @@ -27,6 +27,7 @@ LANGUAGES = \ Italian \ Japanese \ Korean \ + Lithuanian \ Polish \ Portuguese \ Romanian \ diff -rupN squid-2.5.STABLE3/errors/Makefile.in squid-2.5.STABLE4/errors/Makefile.in --- squid-2.5.STABLE3/errors/Makefile.in Tue Feb 11 19:02:09 2003 +++ squid-2.5.STABLE4/errors/Makefile.in Sun May 25 07:56:20 2003 @@ -14,7 +14,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.15.2.8 2003/02/12 02:02:09 hno Exp $ +# $Id: Makefile.in,v 1.15.2.9 2003/05/25 13:56:20 hno Exp $ # SHELL = @SHELL@ @@ -137,6 +137,7 @@ LANGUAGES = \ Italian \ Japanese \ Korean \ + Lithuanian \ Polish \ Portuguese \ Romanian \ diff -rupN squid-2.5.STABLE3/errors/Spanish/ERR_TOO_BIG squid-2.5.STABLE4/errors/Spanish/ERR_TOO_BIG --- squid-2.5.STABLE3/errors/Spanish/ERR_TOO_BIG Wed Aug 28 15:08:14 2002 +++ squid-2.5.STABLE4/errors/Spanish/ERR_TOO_BIG Mon Jul 7 01:49:55 2003 @@ -1,28 +1,27 @@ - - -ERROR: The requested URL could not be retrieved - + +ERROR: La dirección solicitada no puede ser obtenida

ERROR

-

The requested URL could not be retrieved

-
+

La dirección solicitada no puede ser obtenida

+

-While trying to retrieve the URL: +Mientras se descargaba la dirección: %U

-The following error was encountered: +Se encontró el siguiente error:

  • -The request or reply is too large. +La dirección solicitada es demasiado larga.

    -If you are making a POST or PUT request, then your request body -(the thing you are trying to upload) is too large. If you are -making a GET request, then the reply body (what you are trying -to download) is too large. These limits have been established -by the Internet Service Provider who operates this cache. Please -contact them directly if you feel this is an error. +Si está haciendo una petición POST o PUT, el cuerpo (lo +que está intentando subir) es demasiado grande. Si está +haciendo una petición GET, entonces el cuerpo de la respuesta +(que está tratando de bajar) es demasiado grande. Estos +límites fueron establecidos por el Proveedor de Servicios de +Internet que opera este caché. Por favor, contacte con él +directamente si cree que esto es un error.

-Your cache administrator is %w. +Su administrdor del caché es %w. diff -rupN squid-2.5.STABLE3/helpers/basic_auth/LDAP/README squid-2.5.STABLE4/helpers/basic_auth/LDAP/README --- squid-2.5.STABLE3/helpers/basic_auth/LDAP/README Tue Apr 17 18:28:34 2001 +++ squid-2.5.STABLE4/helpers/basic_auth/LDAP/README Wed Aug 20 11:44:08 2003 @@ -14,8 +14,5 @@ For detailed usage information please se nroff -man squid_ldap_auth.8 | less -Please also see Glenns Web page at: -http://orca.cisti.nrc.ca/~gnewton/opensource/squid_ldap_auth/ - In order to use squid_ldap_auth, you will also need to install the OpenLDAP libraries (ldap lber) from http://www.openldap.org. diff -rupN squid-2.5.STABLE3/helpers/basic_auth/NCSA/ncsa_auth.c squid-2.5.STABLE4/helpers/basic_auth/NCSA/ncsa_auth.c --- squid-2.5.STABLE3/helpers/basic_auth/NCSA/ncsa_auth.c Sun Aug 11 19:13:39 2002 +++ squid-2.5.STABLE4/helpers/basic_auth/NCSA/ncsa_auth.c Wed Aug 20 06:35:51 2003 @@ -80,6 +80,10 @@ read_passwd_file(const char *passwdfile) exit(1); } f = fopen(passwdfile, "r"); + if (NULL == f) { + fprintf(stderr, "%s: %s\n", passwdfile, xstrerror()); + exit(1); + } while (fgets(buf, 8192, f) != NULL) { if ((buf[0] == '#') || (buf[0] == ' ') || (buf[0] == '\t') || (buf[0] == '\n')) diff -rupN squid-2.5.STABLE3/helpers/basic_auth/winbind/wb_basic_auth.c squid-2.5.STABLE4/helpers/basic_auth/winbind/wb_basic_auth.c --- squid-2.5.STABLE3/helpers/basic_auth/winbind/wb_basic_auth.c Tue Feb 11 07:35:14 2003 +++ squid-2.5.STABLE4/helpers/basic_auth/winbind/wb_basic_auth.c Fri Sep 12 04:11:21 2003 @@ -31,7 +31,6 @@ char debug_enabled=0; char *myname; pid_t mypid; -int err = 0; NSS_STATUS winbindd_request(int req_type, struct winbindd_request *request, @@ -99,31 +98,24 @@ process_options(int argc, char *argv[]) return; } -void manage_request(void) +int manage_request(void) { char buf[BUFFER_SIZE+1]; int length; char *c, *user, *pass; - if (fgets(buf, BUFFER_SIZE, stdin) == NULL) { - warn("fgets() failed! dying..... errno=%d (%s)\n", errno, - strerror(errno)); - exit(1); /* BIIG buffer */ - } - + if (fgets(buf, BUFFER_SIZE, stdin) == NULL) + return 0; + c=memchr(buf,'\n',BUFFER_SIZE); if (c) { - *c='\0'; - length=c-buf; + *c = '\0'; + length = c-buf; } else { - err = 1; - return; - } - if (err) { warn("Oversized message\n"); + fgets(buf, BUFFER_SIZE, stdin); SEND("ERR"); - err = 0; - return; + return 1; } debug("Got '%s' from squid (length: %d).\n",buf,length); @@ -131,7 +123,7 @@ void manage_request(void) if (buf[0] == '\0') { warn("Invalid Request\n"); SEND("ERR"); - return; + return 1; } user=buf; @@ -140,7 +132,7 @@ void manage_request(void) if (!pass) { warn("Password not found. Denying access\n"); SEND("ERR"); - return; + return 1; } *pass='\0'; pass++; @@ -149,6 +141,29 @@ void manage_request(void) rfc1738_unescape(pass); do_authenticate(user,pass); + return 1; +} + +void +check_winbindd() +{ + NSS_STATUS r; + int retry=10; + struct winbindd_request request; + struct winbindd_response response; + do { + r = winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response); + if (r != NSS_STATUS_SUCCESS) + retry--; + } while (r != NSS_STATUS_SUCCESS && retry); + if (r != NSS_STATUS_SUCCESS) { + warn("Can't contact winbindd. Dying\n"); + exit(1); + } + if (response.data.interface_version != WINBIND_INTERFACE_VERSION) { + warn("Winbind protocol mismatch. Align squid and samba. Dying\n"); + exit(1); + } } @@ -170,8 +185,10 @@ int main (int argc, char ** argv) setbuf(stdout, NULL); setbuf(stderr, NULL); - while(1) { - manage_request(); + check_winbindd(); + + while(manage_request()) { + /* everything is done within manage_request */ } return 0; } diff -rupN squid-2.5.STABLE3/helpers/external_acl/winbind_group/wb_check_group.c squid-2.5.STABLE4/helpers/external_acl/winbind_group/wb_check_group.c --- squid-2.5.STABLE3/helpers/external_acl/winbind_group/wb_check_group.c Sun May 11 06:51:49 2003 +++ squid-2.5.STABLE4/helpers/external_acl/winbind_group/wb_check_group.c Fri Sep 12 04:11:22 2003 @@ -292,6 +292,28 @@ process_options(int argc, char *argv[]) return; } +void +check_winbindd() +{ + NSS_STATUS r; + int retry=10; + struct winbindd_request request; + struct winbindd_response response; + do { + r = winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response); + if (r != NSS_STATUS_SUCCESS) + retry--; + } while (r != NSS_STATUS_SUCCESS && retry); + if (r != NSS_STATUS_SUCCESS) { + warn("Can't contact winbindd. Dying\n"); + exit(1); + } + if (response.data.interface_version != WINBIND_INTERFACE_VERSION) { + warn("Winbind protocol mismatch. Align squid and samba. Dying\n"); + exit(1); + } +} + int main (int argc, char *argv[]) { @@ -323,6 +345,8 @@ main (int argc, char *argv[]) if (use_case_insensitive_compare) debug("Warning: running in case insensitive mode !!!\n"); + check_winbindd(); + /* Main Loop */ while (fgets (buf, BUFSIZE, stdin)) { diff -rupN squid-2.5.STABLE3/helpers/ntlm_auth/winbind/wb_ntlm_auth.c squid-2.5.STABLE4/helpers/ntlm_auth/winbind/wb_ntlm_auth.c --- squid-2.5.STABLE3/helpers/ntlm_auth/winbind/wb_ntlm_auth.c Tue Feb 11 07:35:14 2003 +++ squid-2.5.STABLE4/helpers/ntlm_auth/winbind/wb_ntlm_auth.c Fri Sep 12 04:11:25 2003 @@ -258,7 +258,7 @@ do_authenticate(ntlm_authenticate * auth return; /* useless */ } -void +int manage_request(char *target_domain) { char buf[BUFFER_SIZE + 1]; @@ -268,18 +268,15 @@ manage_request(char *target_domain) try_again: - if (fgets(buf, BUFFER_SIZE, stdin) == NULL) { - warn("fgets() failed! dying..... errno=%d (%s)\n", errno, - strerror(errno)); - exit(1); /* BIIG buffer */ - } + if (fgets(buf, BUFFER_SIZE, stdin) == NULL) + return 0; c = memchr(buf, '\n', BUFFER_SIZE); if (c) { if (oversized) { helperfail("illegal request received"); warn("Illegal request received: '%s'\n", buf); - return; + return 1; } *c = '\0'; } @@ -293,44 +290,44 @@ try_again: if (memcmp(buf, "YR", 2) == 0) { /* refresh-request */ sendchallenge(ntlm_make_challenge(target_domain, NULL, build_challenge(), CHALLENGE_LEN)); - return; + return 1; } if (strncmp(buf, "KK ", 3) != 0) { /* not an auth-request */ helperfail("illegal request received"); warn("Illegal request received: '%s'\n", buf); - return; + return 1; } /* At this point I'm sure it's a KK */ decoded = base64_decode(buf + 3); if (!decoded) { /* decoding failure, return error */ authfail("-", "-", "Auth-format error, base64-decoding error"); - return; + return 1; } fast_header = (struct _ntlmhdr *) decoded; /* sanity-check: it IS a NTLMSSP packet, isn't it? */ if (memcmp(fast_header->signature, "NTLMSSP", 8) != 0) { authfail("-", "-", "Broken NTLM packet, missing NTLMSSP signature"); - return; + return 1; } /* Understand what we got */ switch WSWAP(fast_header->type) { case NTLM_NEGOTIATE: authfail("-", "-", "Received neg-request while expecting auth packet"); - return; + return 1; case NTLM_CHALLENGE: authfail("-", "-", "Received challenge. Refusing to abide"); - return; + return 1; case NTLM_AUTHENTICATE: do_authenticate((ntlm_authenticate *) decoded, (strlen(buf) - 3) * 3 / 4); - return; + return 1; default: helperfail("Unknown authentication packet type"); - return; + return 1; } /* notreached */ - return; + return 1; } static char * @@ -407,9 +404,14 @@ void check_winbindd() { NSS_STATUS r; + int retry=10; struct winbindd_request request; struct winbindd_response response; - r = winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response); + do { + r = winbindd_request(WINBINDD_INTERFACE_VERSION, &request, &response); + if (r != NSS_STATUS_SUCCESS) + retry--; + } while (r != NSS_STATUS_SUCCESS && retry); if (r != NSS_STATUS_SUCCESS) { warn("Can't contact winbindd. Dying\n"); exit(1); @@ -448,8 +450,8 @@ main(int argc, char **argv) setbuf(stdout, NULL); setbuf(stderr, NULL); init_random(); - while (1) { - manage_request(target_domain); + while (manage_request(target_domain)) { + /* everything is done within manage_request */ } return 0; } diff -rupN squid-2.5.STABLE3/include/version.h squid-2.5.STABLE4/include/version.h --- squid-2.5.STABLE3/include/version.h Sun May 25 07:04:25 2003 +++ squid-2.5.STABLE4/include/version.h Sun Sep 14 18:37:04 2003 @@ -9,5 +9,5 @@ */ #ifndef SQUID_RELEASE_TIME -#define SQUID_RELEASE_TIME 1053867833 +#define SQUID_RELEASE_TIME 1063586207 #endif diff -rupN squid-2.5.STABLE3/lib/GNUregex.c squid-2.5.STABLE4/lib/GNUregex.c --- squid-2.5.STABLE3/lib/GNUregex.c Sun Jan 7 02:55:22 2001 +++ squid-2.5.STABLE4/lib/GNUregex.c Thu Jun 19 18:09:06 2003 @@ -1,5 +1,5 @@ /* - * $Id: GNUregex.c,v 1.12 2001/01/07 09:55:22 hno Exp $ + * $Id: GNUregex.c,v 1.12.2.1 2003/06/20 00:09:06 hno Exp $ */ /* Extended regular expression matching and search library, @@ -87,7 +87,7 @@ extern char *re_syntax_table; static char re_syntax_table[CHAR_SET_SIZE]; static void -init_syntax_once() +init_syntax_once(void) { register int c; static int done = 0; @@ -819,12 +819,6 @@ static const char *re_error_msg[] = /* Subroutine declarations and macros for regex_compile. */ -static void store_op1(), store_op2(); -static void insert_op1(), insert_op2(); -static boolean at_begline_loc_p(), at_endline_loc_p(); -static boolean group_in_compile_stack(); -static reg_errcode_t compile_range(); - /* Fetch the next character in the uncompiled pattern---translating it * if necessary. Also cast from a signed character in the constant * string passed to us by the user to an unsigned char that we can use @@ -975,6 +969,14 @@ typedef struct { unsigned avail; /* Offset of next open position. */ } compile_stack_type; +static void store_op1(re_opcode_t op, unsigned char *loc, int arg); +static void store_op2( re_opcode_t op, unsigned char *loc, int arg1, int arg2); +static void insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end); +static void insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end); +static boolean at_begline_loc_p(const char * pattern, const char *p, reg_syntax_t syntax); +static boolean at_endline_loc_p(const char *p, const char *pend, int syntax); +static boolean group_in_compile_stack(compile_stack_type compile_stack, regnum_t regnum); +static reg_errcode_t compile_range(const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b); #define INIT_COMPILE_STACK_SIZE 32 @@ -1037,11 +1039,7 @@ typedef struct { * examined nor set. */ static reg_errcode_t -regex_compile(pattern, size, syntax, bufp) - const char *pattern; - int size; - reg_syntax_t syntax; - struct re_pattern_buffer *bufp; +regex_compile(const char *pattern, int size, reg_syntax_t syntax, struct re_pattern_buffer *bufp) { /* We fetch characters from PATTERN here. Even though PATTERN is * `char *' (i.e., signed), we declare these variables as unsigned, so @@ -1992,11 +1990,7 @@ regex_compile(pattern, size, syntax, buf /* Store OP at LOC followed by two-byte integer parameter ARG. */ -static void -store_op1(op, loc, arg) - re_opcode_t op; - unsigned char *loc; - int arg; +void store_op1(re_opcode_t op, unsigned char *loc, int arg) { *loc = (unsigned char) op; STORE_NUMBER(loc + 1, arg); @@ -2005,11 +1999,8 @@ store_op1(op, loc, arg) /* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */ -static void -store_op2(op, loc, arg1, arg2) - re_opcode_t op; - unsigned char *loc; - int arg1, arg2; +void +store_op2( re_opcode_t op, unsigned char *loc, int arg1, int arg2) { *loc = (unsigned char) op; STORE_NUMBER(loc + 1, arg1); @@ -2020,12 +2011,8 @@ store_op2(op, loc, arg1, arg2) /* Copy the bytes from LOC to END to open up three bytes of space at LOC * for OP followed by two-byte integer parameter ARG. */ -static void -insert_op1(op, loc, arg, end) - re_opcode_t op; - unsigned char *loc; - int arg; - unsigned char *end; +void +insert_op1(re_opcode_t op, unsigned char *loc, int arg, unsigned char *end) { register unsigned char *pfrom = end; register unsigned char *pto = end + 3; @@ -2039,12 +2026,8 @@ insert_op1(op, loc, arg, end) /* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */ -static void -insert_op2(op, loc, arg1, arg2, end) - re_opcode_t op; - unsigned char *loc; - int arg1, arg2; - unsigned char *end; +void +insert_op2(re_opcode_t op, unsigned char *loc, int arg1, int arg2, unsigned char *end) { register unsigned char *pfrom = end; register unsigned char *pto = end + 5; @@ -2060,10 +2043,8 @@ insert_op2(op, loc, arg1, arg2, end) * after an alternative or a begin-subexpression. We assume there is at * least one character before the ^. */ -static boolean -at_begline_loc_p(pattern, p, syntax) - const char *pattern, *p; - reg_syntax_t syntax; +boolean +at_begline_loc_p(const char * pattern, const char *p, reg_syntax_t syntax) { const char *prev = p - 2; boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\'; @@ -2079,10 +2060,8 @@ at_begline_loc_p(pattern, p, syntax) /* The dual of at_begline_loc_p. This one is for $. We assume there is * at least one character after the $, i.e., `P < PEND'. */ -static boolean -at_endline_loc_p(p, pend, syntax) - const char *p, *pend; - int syntax; +boolean +at_endline_loc_p(const char *p, const char *pend, int syntax) { const char *next = p; boolean next_backslash = *next == '\\'; @@ -2101,10 +2080,8 @@ at_endline_loc_p(p, pend, syntax) /* Returns true if REGNUM is in one of COMPILE_STACK's elements and * false if it's not. */ -static boolean -group_in_compile_stack(compile_stack, regnum) - compile_stack_type compile_stack; - regnum_t regnum; +boolean +group_in_compile_stack(compile_stack_type compile_stack, regnum_t regnum) { int this_element; @@ -2129,12 +2106,8 @@ group_in_compile_stack(compile_stack, re * We use these short variable names so we can use the same macros as * `regex_compile' itself. */ -static reg_errcode_t -compile_range(p_ptr, pend, translate, syntax, b) - const char **p_ptr, *pend; - char *translate; - reg_syntax_t syntax; - unsigned char *b; +reg_errcode_t +compile_range(const char **p_ptr, const char *pend, char *translate, reg_syntax_t syntax, unsigned char *b) { unsigned this_char; @@ -2900,10 +2873,6 @@ re_search_2(bufp, string1, size1, string /* Declarations and macros for re_match_2. */ -static int bcmp_translate(); -static boolean alt_match_null_string_p(), common_op_match_null_string_p(), - group_match_null_string_p(); - /* Structure for per-register (a.k.a. per-group) information. * This must not be longer than one word, because we push this value * onto the failure stack. Other register information, such as the @@ -2927,6 +2896,10 @@ typedef union { unsigned ever_matched_something:1; } bits; } register_info_type; +static boolean alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info); +static boolean common_op_match_null_string_p( unsigned char **p, unsigned char *end, register_info_type *reg_info); +static int bcmp_translate(unsigned char const *s1, unsigned char const *s2, register int len, char *translate); +static boolean group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info); #define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p) #define IS_ACTIVE(R) ((R).bits.is_active) @@ -4175,7 +4148,6 @@ re_match_2(bufp, string1, size1, string2 /* Subroutine definitions for re_match_2. */ - /* We are passed P pointing to a register number after a start_memory. * * Return true if the pattern up to the corresponding stop_memory can @@ -4186,10 +4158,8 @@ re_match_2(bufp, string1, size1, string2 * * We don't handle duplicates properly (yet). */ -static boolean -group_match_null_string_p(p, end, reg_info) - unsigned char **p, *end; - register_info_type *reg_info; +boolean +group_match_null_string_p(unsigned char **p, unsigned char *end, register_info_type *reg_info) { int mcnt; /* Point to after the args to the start_memory. */ @@ -4290,10 +4260,8 @@ group_match_null_string_p(p, end, reg_in * It expects P to be the first byte of a single alternative and END one * byte past the last. The alternative can contain groups. */ -static boolean -alt_match_null_string_p(p, end, reg_info) - unsigned char *p, *end; - register_info_type *reg_info; +boolean +alt_match_null_string_p(unsigned char *p, unsigned char *end, register_info_type *reg_info) { int mcnt; unsigned char *p1 = p; @@ -4325,10 +4293,8 @@ alt_match_null_string_p(p, end, reg_info * * Sets P to one after the op and its arguments, if any. */ -static boolean -common_op_match_null_string_p(p, end, reg_info) - unsigned char **p, *end; - register_info_type *reg_info; +boolean +common_op_match_null_string_p( unsigned char **p, unsigned char *end, register_info_type *reg_info) { int mcnt; boolean ret; @@ -4410,13 +4376,10 @@ common_op_match_null_string_p(p, end, re /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN * bytes; nonzero otherwise. */ -static int -bcmp_translate(s1, s2, len, translate) - unsigned char *s1, *s2; - register int len; - char *translate; +int +bcmp_translate(unsigned char const *s1, unsigned char const*s2, register int len, char *translate) { - register unsigned char *p1 = s1, *p2 = s2; + register unsigned char const *p1 = s1, *p2 = s2; while (len) { if (translate[*p1++] != translate[*p2++]) return 1; diff -rupN squid-2.5.STABLE3/lib/radix.c squid-2.5.STABLE4/lib/radix.c --- squid-2.5.STABLE3/lib/radix.c Tue Nov 13 12:24:34 2001 +++ squid-2.5.STABLE4/lib/radix.c Wed Jun 18 17:53:34 2003 @@ -1,5 +1,5 @@ /* - * $Id: radix.c,v 1.16 2001/11/13 19:24:34 hno Exp $ + * $Id: radix.c,v 1.16.2.1 2003/06/18 23:53:34 hno Exp $ * * DEBUG: section 53 Radix tree data structure implementation * AUTHOR: NetBSD Derived @@ -113,9 +113,15 @@ #include "radix.h" + int squid_max_keylen; struct squid_radix_mask *squid_rn_mkfreelist; -struct squid_radix_node_head *squid_mask_rnhead; +/* Silly construct to get rid of GCC-3.3 warning about type-punning */ +union { + struct squid_radix_node_head *rn; + void *ptr; +} squid_mask_rnhead_u; +#define squid_mask_rnhead squid_mask_rnhead_u.rn static char *addmask_key; static unsigned char normal_chars[] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xFF}; @@ -981,7 +987,7 @@ squid_rn_init(void) addmask_key = cplim = rn_ones + squid_max_keylen; while (cp < cplim) *cp++ = -1; - if (squid_rn_inithead((void **) &squid_mask_rnhead, 0) == 0) { + if (squid_rn_inithead(&squid_mask_rnhead_u.ptr, 0) == 0) { fprintf(stderr, "rn_init2 failed.\n"); exit(-1); } diff -rupN squid-2.5.STABLE3/lib/rfc1738.c squid-2.5.STABLE4/lib/rfc1738.c --- squid-2.5.STABLE3/lib/rfc1738.c Wed Feb 7 11:56:51 2001 +++ squid-2.5.STABLE4/lib/rfc1738.c Wed Jun 18 17:53:34 2003 @@ -1,5 +1,5 @@ /* - * $Id: rfc1738.c,v 1.23 2001/02/07 18:56:51 hno Exp $ + * $Id: rfc1738.c,v 1.23.2.1 2003/06/18 23:53:34 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -128,8 +128,7 @@ rfc1738_do_escape(const char *url, int e do_escape = 1; } /* RFC 1738 says any non-US-ASCII are encoded */ - if (((unsigned char) *p >= (unsigned char) 0x80) && - ((unsigned char) *p <= (unsigned char) 0xFF)) { + if (((unsigned char) *p >= (unsigned char) 0x80)) { do_escape = 1; } /* Do the triplet encoding, or just copy the char */ diff -rupN squid-2.5.STABLE3/src/HttpHeader.c squid-2.5.STABLE4/src/HttpHeader.c --- squid-2.5.STABLE3/src/HttpHeader.c Sun May 11 11:30:12 2003 +++ squid-2.5.STABLE4/src/HttpHeader.c Thu Jul 17 16:06:12 2003 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.c,v 1.74.2.5 2003/05/11 17:30:12 hno Exp $ + * $Id: HttpHeader.c,v 1.74.2.7 2003/07/17 22:06:12 wessels Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -325,7 +325,18 @@ httpHeaderClean(HttpHeader * hdr) assert(hdr->owner > hoNone && hdr->owner <= hoReply); debug(55, 7) ("cleaning hdr: %p owner: %d\n", hdr, hdr->owner); - statHistCount(&HttpHeaderStats[hdr->owner].hdrUCountDistr, hdr->entries.count); + /* + * An unfortunate bug. The hdr->entries array is initialized + * such that count is set to zero. httpHeaderClean() seems to + * be called both when 'hdr' is created, and destroyed. Thus, + * we accumulate a large number of zero counts for 'hdr' before + * it is ever used. Can't think of a good way to fix it, except + * adding a state variable that indicates whether or not 'hdr' + * has been used. As a hack, just never count zero-sized header + * arrays. + */ + if (0 != hdr->entries.count) + statHistCount(&HttpHeaderStats[hdr->owner].hdrUCountDistr, hdr->entries.count); HttpHeaderStats[hdr->owner].destroyedCount++; HttpHeaderStats[hdr->owner].busyDestroyedCount += hdr->entries.count > 0; while ((e = httpHeaderGetEntry(hdr, &pos))) { @@ -335,7 +346,7 @@ httpHeaderClean(HttpHeader * hdr) (int) pos, e->id); } else { statHistCount(&HttpHeaderStats[hdr->owner].fieldTypeDistr, e->id); - /* yes, this destroy() leaves us in an incosistent state */ + /* yes, this destroy() leaves us in an inconsistent state */ httpHeaderEntryDestroy(e); } } @@ -538,7 +549,7 @@ httpHeaderDelById(HttpHeader * hdr, http debug(55, 8) ("%p del-by-id %d\n", hdr, id); assert(hdr); assert_eid(id); - assert_eid(id != HDR_OTHER); /* does not make sense */ + assert(id != HDR_OTHER); /* does not make sense */ if (!CBIT_TEST(hdr->mask, id)) return 0; while ((e = httpHeaderGetEntry(hdr, &pos))) { diff -rupN squid-2.5.STABLE3/src/HttpHeaderTools.c squid-2.5.STABLE4/src/HttpHeaderTools.c --- squid-2.5.STABLE3/src/HttpHeaderTools.c Tue May 20 17:51:15 2003 +++ squid-2.5.STABLE4/src/HttpHeaderTools.c Mon May 26 06:14:27 2003 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.c,v 1.32.2.1 2003/05/20 23:51:15 hno Exp $ + * $Id: HttpHeaderTools.c,v 1.32.2.2 2003/05/26 12:14:27 hno Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -244,11 +244,12 @@ int strListGetItem(const String * str, char del, const char **item, int *ilen, const char **pos) { size_t len; - char delim[2][3] = + static char delim[2][3] = { - {'"', del, 0}, + {'"', 0, 0}, {'"', '\\', 0}}; int quoted = 0; + delim[0][1] = del; assert(str && item && pos); if (*pos) { if (!**pos) /* end of string */ diff -rupN squid-2.5.STABLE3/src/access_log.c squid-2.5.STABLE4/src/access_log.c --- squid-2.5.STABLE3/src/access_log.c Sun Jun 16 05:25:40 2002 +++ squid-2.5.STABLE4/src/access_log.c Mon Jul 28 02:59:28 2003 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.72.2.2 2002/06/16 11:25:40 hno Exp $ + * $Id: access_log.c,v 1.72.2.4 2003/07/28 08:59:28 adrian Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -147,10 +147,10 @@ log_quote(const char *header) #endif if (c <= 0x1F || c >= 0x7F + || c == '%' #if OLD_LOG_MIME || c == '"' || c == '#' - || c == '%' || c == ';' || c == '<' || c == '>' @@ -210,6 +210,7 @@ username_quote(const char *header) *buf_cursor++ = 'n'; } else if (c <= 0x1F || c >= 0x7F + || c == '%' || c == ' ') { *buf_cursor++ = '%'; i = c * 2; @@ -227,6 +228,8 @@ static char * accessLogFormatName(const char *name) { if (NULL == name) + return NULL; + if (name[0] == '\0') return NULL; return username_quote(name); } diff -rupN squid-2.5.STABLE3/src/asn.c squid-2.5.STABLE4/src/asn.c --- squid-2.5.STABLE3/src/asn.c Tue Nov 13 12:24:35 2001 +++ squid-2.5.STABLE4/src/asn.c Wed Jun 18 17:53:34 2003 @@ -1,6 +1,6 @@ /* - * $Id: asn.c,v 1.78 2001/11/13 19:24:35 hno Exp $ + * $Id: asn.c,v 1.78.2.1 2003/06/18 23:53:34 hno Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -50,7 +50,13 @@ typedef u_char m_int[1 + sizeof(unsigned /* END of definitions for radix tree entries */ /* Head for ip to asn radix tree */ -struct squid_radix_node_head *AS_tree_head; +/* Silly union construct to get rid of GCC-3.3 warning */ +union { + struct squid_radix_node_head *rn; + void *ptr; +} AS_tree_head_u; + +#define AS_tree_head AS_tree_head_u.rn /* * Structure for as number information. it could be simply @@ -160,7 +166,7 @@ asnInit(void) CBDATA_INIT_TYPE(ASState); if (0 == inited++) squid_rn_init(); - squid_rn_inithead((void **) &AS_tree_head, 8); + squid_rn_inithead(&AS_tree_head_u.ptr, 8); asnAclInitialize(Config.aclList); cachemgrRegister("asndb", "AS Number Database", asnStats, 0, 1); } diff -rupN squid-2.5.STABLE3/src/auth/basic/auth_basic.c squid-2.5.STABLE4/src/auth/basic/auth_basic.c --- squid-2.5.STABLE3/src/auth/basic/auth_basic.c Wed Jan 8 13:59:02 2003 +++ squid-2.5.STABLE4/src/auth/basic/auth_basic.c Sun Aug 10 12:53:38 2003 @@ -1,5 +1,5 @@ /* - * $Id: auth_basic.c,v 1.14.2.2 2003/01/08 20:59:02 wessels Exp $ + * $Id: auth_basic.c,v 1.14.2.3 2003/08/10 18:53:38 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -212,7 +212,7 @@ authenticateBasicDirection(auth_user_req case 2: /* paused while waiting for a username:password check on another request */ return -1; case 3: /* authentication process failed. */ - return -2; + return 0; } return -2; } diff -rupN squid-2.5.STABLE3/src/auth/digest/auth_digest.c squid-2.5.STABLE4/src/auth/digest/auth_digest.c --- squid-2.5.STABLE3/src/auth/digest/auth_digest.c Sun May 18 15:49:20 2003 +++ squid-2.5.STABLE4/src/auth/digest/auth_digest.c Sun Aug 10 01:31:33 2003 @@ -1,6 +1,6 @@ /* - * $Id: auth_digest.c,v 1.10.2.6 2003/05/18 21:49:20 hno Exp $ + * $Id: auth_digest.c,v 1.10.2.7 2003/08/10 07:31:33 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Robert Collins @@ -711,8 +711,13 @@ authenticateDigestAuthenticateUser(auth_ return; } else { const char *useragent = httpHeaderGetStr(&request->header, HDR_USER_AGENT); - static struct in_addr last_broken_addr = - {0}; + static struct in_addr last_broken_addr; + static int seen_broken_client = 0; + + if (!seen_broken_client) { + last_broken_addr = no_addr; + seen_broken_client = 1; + } if (memcmp(&last_broken_addr, &request->client_addr, sizeof(last_broken_addr)) != 0) { debug(29, 1) ("\nDigest POST bug detected from %s using '%s'. Please upgrade browser. See Bug #630 for details.\n", inet_ntoa(request->client_addr), useragent ? useragent : "-"); last_broken_addr = request->client_addr; diff -rupN squid-2.5.STABLE3/src/cache_cf.c squid-2.5.STABLE4/src/cache_cf.c --- squid-2.5.STABLE3/src/cache_cf.c Wed Feb 5 22:01:07 2003 +++ squid-2.5.STABLE4/src/cache_cf.c Tue Jul 1 14:42:41 2003 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.396.2.13 2003/02/06 05:01:07 wessels Exp $ + * $Id: cache_cf.c,v 1.396.2.14 2003/07/01 20:42:41 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -350,8 +350,6 @@ configDoConfigure(void) Config.appendDomainLen = 0; safe_free(debug_options) debug_options = xstrdup(Config.debugOptions); - if (Config.retry.timeout < 5) - fatal("minimum_retry_timeout must be at least 5 seconds"); if (Config.retry.maxtries > 10) fatal("maximum_single_addr_tries cannot be larger than 10"); if (Config.retry.maxtries < 1) { diff -rupN squid-2.5.STABLE3/src/carp.c squid-2.5.STABLE4/src/carp.c --- squid-2.5.STABLE3/src/carp.c Thu Jan 11 17:37:15 2001 +++ squid-2.5.STABLE4/src/carp.c Thu Jun 19 15:06:19 2003 @@ -1,6 +1,6 @@ /* - * $Id: carp.c,v 1.15 2001/01/12 00:37:15 wessels Exp $ + * $Id: carp.c,v 1.15.2.1 2003/06/19 21:06:19 wessels Exp $ * * DEBUG: section 39 Cache Array Routing Protocol * AUTHOR: Eric Stern @@ -51,8 +51,20 @@ carpInit(void) double X_last; int k; peer *p; + P_last = 0; for (p = Config.peers; p; p = p->next) { + if (P_last > p->carp.load_factor) { + /* + * Section 3.3 of draft-vinod-carp-v1-03.txt says: + * + * The Load Factor Multiplier must be calculated from the smallest + * P_k to the largest P_k. The sum of all P_k's must be 1. + */ + debug(39, 0) ("WARNING: CARP load factor values must not decrease\n"); + debug(39, 0) ("WARNING: rearrange cache_peer lines so they increase\n"); + } a += p->carp.load_factor; + P_last = p->carp.load_factor; K++; } if (a == 0.0) { diff -rupN squid-2.5.STABLE3/src/cbdata.c squid-2.5.STABLE4/src/cbdata.c --- squid-2.5.STABLE3/src/cbdata.c Wed Oct 17 13:43:39 2001 +++ squid-2.5.STABLE4/src/cbdata.c Wed Jul 16 01:18:43 2003 @@ -1,6 +1,6 @@ /* - * $Id: cbdata.c,v 1.42 2001/10/17 19:43:39 hno Exp $ + * $Id: cbdata.c,v 1.42.2.1 2003/07/16 07:18:43 hno Exp $ * * DEBUG: section 45 Callback Data Registry * ORIGINAL AUTHOR: Duane Wessels @@ -183,6 +183,7 @@ cbdataInternalFree(void *p) debug(45, 3) ("cbdataFree: %p\n", p); c = (cbdata *) (((char *) p) - OFFSET_OF(cbdata, data)); assert(c->y == c); + assert(c->valid); c->valid = 0; if (c->locks) { debug(45, 3) ("cbdataFree: %p has %d locks, not freeing\n", diff -rupN squid-2.5.STABLE3/src/cf.data.pre squid-2.5.STABLE4/src/cf.data.pre --- squid-2.5.STABLE3/src/cf.data.pre Wed May 21 08:34:38 2003 +++ squid-2.5.STABLE4/src/cf.data.pre Tue Sep 2 01:49:32 2003 @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.245.2.43 2003/05/21 14:34:38 hno Exp $ +# $Id: cf.data.pre,v 1.245.2.50 2003/09/02 07:49:32 hno Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -416,7 +416,7 @@ TYPE: hostdomaintype DEFAULT: none LOC: none DOC_START - usage: neighbor_type_domain parent|sibling domain domain ... + usage: neighbor_type_domain neighbor parent|sibling domain domain ... Modifying the neighbor type for specific domains is now possible. You can treat some domains differently than the the @@ -742,8 +742,6 @@ DOC_START cache_dir Type Directory-Name Fs-specific-data [options] - cache_dir diskd Maxobjsize Directory-Name MB L1 L2 Q1 Q2 - You can specify multiple cache_dir lines to spread the cache among different disk partitions. @@ -805,6 +803,16 @@ DOC_START starts blocking. If this many messages are in the queues, Squid blocks until it recevies some replies. Default is 72 + The coss store type: + + block-size=n defines the "block size" for COSS cache_dir's. + Squid uses file numbers as block numbers. Since file numbers + are limited to 24 bits, the block size determines the maximum + size of the COSS partition. The default is 512 bytes, which + leads to a maximum cache_dir size of 512<<24, or 8 GB. Note + that you should not change the coss block size after Squid + has written some objects to the cache_dir. + Common options: read-only, this cache_dir is read only. @@ -814,6 +822,9 @@ DOC_START Note: To make optimal use of the max-size limits you should order the cache_dir lines with the smallest max-size value first and the ones with no max-size specification last. + + Note that for coss, max-size must be less than COSS_MEMBUF_SZ + (hard coded at 1 MB). DOC_END @@ -1475,8 +1486,9 @@ DOC_START negative_ttl=n TTL for cached negative lookups (default same as ttl) - concurrency=n Concurrency level / number of processes spawn + children=n Concurrency level / number of processes spawn to service external acl lookups of this type. + Note: see compatibility note below cache=n result cache size, 0 is unbounded (default) FORMAT specifications @@ -1516,6 +1528,15 @@ DOC_START Keyword values need to be enclosed in quotes if they may contain whitespace, or the whitespace escaped using \. Any quotes or \ characters within the keyword value must be \ escaped. + + Compatibility Note: The children= option was named concurrency= in + Squid-2.5.STABLE3 and earlier and such syntax is still accepted to + keep compatibility within the Squid-2.5 release. However, the meaning + of concurrency= option has changed in Squid-3 and the old syntax of + the directive is therefore depreated from Squid-2.5.STABLE4 and later. + If you want to be able to easily downgrade to earlier Squid-2.5 + releases then you may want to continue using the old name, if not + please use the new name. DOC_END COMMENT_START @@ -2283,11 +2304,6 @@ DOC_START partial responses and give them out as hits. You should NOT use this option if you have downstream caches. - WARNING: A maximum size smaller than the size of squid's error messages - will cause an infinite loop and crash squid. Ensure that the smallest - non-zero value you use is greater that the maximum header size plus - the size of your largest error page. - If you set this parameter to zero (the default), there will be no limit imposed. DOC_END @@ -3088,28 +3104,6 @@ DOC_START directory and point this tag at them. DOC_END -NAME: minimum_retry_timeout -COMMENT: (seconds) -TYPE: time_t -LOC: Config.retry.timeout -DEFAULT: 5 seconds -DOC_START - This specifies the minimum connect timeout, for when the - connect timeout is reduced to compensate for the availability - of multiple IP addresses. - - When a connection to a host is initiated, and that host has - several IP addresses, the default connection timeout is reduced - by dividing it by the number of addresses. So, a site with 15 - addresses would then have a timeout of 8 seconds for each - address attempted. To avoid having the timeout reduced to the - point where even a working host would not have a chance to - respond, this setting is provided. The default, and the - minimum value, is five seconds, and the maximum value is sixty - seconds, or half of connect_timeout, whichever is greater and - less than connect_timeout. -DOC_END - NAME: maximum_single_addr_tries TYPE: int LOC: Config.retry.maxtries @@ -3468,7 +3462,7 @@ DOC_START URI. Options: strip: The whitespace characters are stripped out of the URL. - This is the behavior recommended by RFC2616. + This is the behavior recommended by RFC2396. deny: The request is denied. The user receives an "Invalid Request" message. allow: The request is allowed and the URI is not changed. The diff -rupN squid-2.5.STABLE3/src/client_side.c squid-2.5.STABLE4/src/client_side.c --- squid-2.5.STABLE3/src/client_side.c Sat May 24 05:08:41 2003 +++ squid-2.5.STABLE4/src/client_side.c Mon Sep 1 14:39:33 2003 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.561.2.36 2003/05/24 11:08:41 robertc Exp $ + * $Id: client_side.c,v 1.561.2.46 2003/09/01 20:39:33 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -127,6 +127,7 @@ static log_type clientProcessRequest2(cl static int clientReplyBodyTooLarge(clientHttpRequest *, ssize_t clen); static int clientRequestBodyTooLarge(int clen); static void clientProcessBody(ConnStateData * conn); +static void clientEatRequestBody(clientHttpRequest *); static int checkAccelOnly(clientHttpRequest * http) @@ -216,7 +217,8 @@ clientCreateStoreEntry(clientHttpRequest e = storeCreateEntry(h->uri, h->log_uri, flags, m); h->sc = storeClientListAdd(e, h); #if DELAY_POOLS - delaySetStoreClient(h->sc, delayClient(h)); + if (h->log_type != LOG_TCP_DENIED) + delaySetStoreClient(h->sc, delayClient(h)); #endif storeClientCopy(h->sc, e, 0, 0, CLIENT_SOCK_SZ, memAllocate(MEM_CLIENT_SOCK_BUF), clientSendMoreData, h); @@ -244,6 +246,7 @@ clientAccessCheckDone(int answer, void * http->redirect_state = REDIRECT_PENDING; redirectStart(http, clientRedirectDone, http); } else { + int require_auth = (answer == ACCESS_REQ_PROXY_AUTH || aclIsProxyAuth(AclMatchedName)); debug(33, 5) ("Access Denied: %s\n", http->uri); debug(33, 5) ("AclMatchedName = %s\n", AclMatchedName ? AclMatchedName : ""); @@ -259,7 +262,7 @@ clientAccessCheckDone(int answer, void * http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, http->request->method, null_request_flags); - if (answer == ACCESS_REQ_PROXY_AUTH || aclIsProxyAuth(AclMatchedName)) { + if (require_auth) { if (!http->flags.accel) { /* Proxy authorisation needed */ status = HTTP_PROXY_AUTHENTICATION_REQUIRED; @@ -783,7 +786,7 @@ httpRequestFree(void *data) debug(33, 3) ("httpRequestFree: %s\n", storeUrl(http->entry)); if (!clientCheckTransferDone(http)) { if (request && request->body_connection) - clientAbortBody(request); /* abort body transter */ + clientAbortBody(request); /* abort request body transter */ /* HN: This looks a bit odd.. why should client_side care about * the ICP selection status? */ @@ -1461,7 +1464,7 @@ clientCacheHit(void *data, char *buf, ss memFree(buf, MEM_CLIENT_SOCK_BUF); debug(33, 3) ("clientCacheHit: request aborted\n"); return; - } else if (size < 0) { + } else if (size <= 0) { /* swap in failure */ memFree(buf, MEM_CLIENT_SOCK_BUF); debug(33, 3) ("clientCacheHit: swapin failure for %s\n", http->uri); @@ -1912,6 +1915,7 @@ clientSendMoreData(void *data, char *buf memFree(buf, MEM_CLIENT_SOCK_BUF); return; } else if (http->request->flags.reset_tcp) { + memFree(buf, MEM_CLIENT_SOCK_BUF); comm_reset_close(fd); return; } else if (entry && EBIT_TEST(entry->flags, ENTRY_ABORTED)) { @@ -1944,16 +1948,18 @@ clientSendMoreData(void *data, char *buf aclCheck_t *ch; int rv; clientMaxBodySize(http->request, http, rep); - if (clientReplyBodyTooLarge(http, rep->content_length)) { + if (http->log_type != LOG_TCP_DENIED && clientReplyBodyTooLarge(http, rep->content_length)) { ErrorState *err = errorCon(ERR_TOO_BIG, HTTP_FORBIDDEN); err->request = requestLink(http->request); storeUnregister(http->sc, http->entry, http); http->sc = NULL; storeUnlockObject(http->entry); + http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, http->request->method, null_request_flags); errorAppendEntry(http->entry, err); httpReplyDestroy(rep); + memFree(buf, MEM_CLIENT_SOCK_BUF); return; } body_size = size - rep->hdr_sz; @@ -1962,31 +1968,31 @@ clientSendMoreData(void *data, char *buf http->range_iter.prefix_size = rep->hdr_sz; debug(33, 3) ("clientSendMoreData: Appending %d bytes after %d bytes of headers\n", (int) body_size, rep->hdr_sz); - ch = clientAclChecklistCreate(Config.accessList.reply, http); - ch->reply = rep; - rv = aclCheckFast(Config.accessList.reply, ch); - aclChecklistFree(ch); - ch = NULL; - debug(33, 2) ("The reply for %s %s is %s, because it matched '%s'\n", - RequestMethodStr[http->request->method], http->uri, - rv ? "ALLOWED" : "DENIED", - AclMatchedName ? AclMatchedName : "NO ACL's"); - if (!rv && rep->sline.status != HTTP_FORBIDDEN - && !clientAlwaysAllowResponse(rep->sline.status)) { - /* the if above is slightly broken, but there is no way - * to tell if this is a squid generated error page, or one from - * upstream at this point. */ - ErrorState *err; - err = errorCon(ERR_ACCESS_DENIED, HTTP_FORBIDDEN); - err->request = requestLink(http->request); - storeUnregister(http->sc, http->entry, http); - http->sc = NULL; - storeUnlockObject(http->entry); - http->entry = clientCreateStoreEntry(http, http->request->method, - null_request_flags); - errorAppendEntry(http->entry, err); - httpReplyDestroy(rep); - return; + if (http->log_type != LOG_TCP_DENIED && !clientAlwaysAllowResponse(rep->sline.status)) { + ch = clientAclChecklistCreate(Config.accessList.reply, http); + ch->reply = rep; + rv = aclCheckFast(Config.accessList.reply, ch); + aclChecklistFree(ch); + ch = NULL; + debug(33, 2) ("The reply for %s %s is %s, because it matched '%s'\n", + RequestMethodStr[http->request->method], http->uri, + rv ? "ALLOWED" : "DENIED", + AclMatchedName ? AclMatchedName : "NO ACL's"); + if (!rv) { + ErrorState *err; + err = errorCon(ERR_ACCESS_DENIED, HTTP_FORBIDDEN); + err->request = requestLink(http->request); + storeUnregister(http->sc, http->entry, http); + http->sc = NULL; + storeUnlockObject(http->entry); + http->log_type = LOG_TCP_DENIED; + http->entry = clientCreateStoreEntry(http, http->request->method, + null_request_flags); + errorAppendEntry(http->entry, err); + httpReplyDestroy(rep); + memFree(buf, MEM_CLIENT_SOCK_BUF); + return; + } } } else if (size < CLIENT_SOCK_SZ && entry->store_status == STORE_PENDING) { /* wait for more to arrive */ @@ -2191,6 +2197,15 @@ clientWriteComplete(int fd, char *bufnot } else if (clientGotNotEnough(http)) { debug(33, 5) ("clientWriteComplete: client didn't get all it expected\n"); comm_close(fd); + } else if (http->request->body_connection) { + debug(33, 5) ("clientWriteComplete: closing, but first we need to read the rest of the request\n"); + /* XXX We assumes the reply does fit in the TCP transmit window. + * If not the connection may stall while sending the reply + * (before reaching here) if the client does not try to read the + * response while sending the request body. As of yet we have + * not received any complaints indicating this may be an issue. + */ + clientEatRequestBody(http); } else if (http->request->flags.proxy_keepalive) { debug(33, 5) ("clientWriteComplete: FD %d Keeping Alive\n", fd); clientKeepaliveNextRequest(http); @@ -2379,6 +2394,7 @@ clientProcessRequest(clientHttpRequest * return; } else if (r->method == METHOD_TRACE) { if (r->max_forwards == 0) { + http->log_type = LOG_TCP_HIT; http->entry = clientCreateStoreEntry(http, r->method, null_request_flags); storeReleaseRequest(http->entry); storeBuffer(http->entry); @@ -2464,6 +2480,7 @@ clientProcessMiss(clientHttpRequest * ht err = errorCon(ERR_ACCESS_DENIED, HTTP_FORBIDDEN); err->request = requestLink(r); err->src_addr = http->conn->peer.sin_addr; + http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, r->method, null_request_flags); errorAppendEntry(http->entry, err); return; @@ -2986,6 +3003,7 @@ clientReadRequest(int fd, void *data) debug(33, 1) ("clientReadRequest: FD %d Invalid Request\n", fd); err = errorCon(ERR_INVALID_REQ, HTTP_BAD_REQUEST); err->request_hdrs = xstrdup(conn->in.buf); + http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, method, null_request_flags); errorAppendEntry(http->entry, err); safe_free(prefix); @@ -2997,6 +3015,7 @@ clientReadRequest(int fd, void *data) err->src_addr = conn->peer.sin_addr; err->url = xstrdup(http->uri); http->al.http.code = err->http_status; + http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, method, null_request_flags); errorAppendEntry(http->entry, err); safe_free(prefix); @@ -3042,6 +3061,7 @@ clientReadRequest(int fd, void *data) err->request = requestLink(request); request->flags.proxy_keepalive = 0; http->al.http.code = err->http_status; + http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, request->method, null_request_flags); errorAppendEntry(http->entry, err); break; @@ -3051,6 +3071,7 @@ clientReadRequest(int fd, void *data) err->src_addr = conn->peer.sin_addr; err->request = requestLink(request); http->al.http.code = err->http_status; + http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, request->method, null_request_flags); errorAppendEntry(http->entry, err); break; @@ -3065,6 +3086,7 @@ clientReadRequest(int fd, void *data) if (clientRequestBodyTooLarge(request->content_length)) { err = errorCon(ERR_TOO_BIG, HTTP_REQUEST_ENTITY_TOO_LARGE); err->request = requestLink(request); + http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, METHOD_NONE, null_request_flags); errorAppendEntry(http->entry, err); @@ -3134,6 +3156,43 @@ clientReadBody(request_t * request, char clientProcessBody(conn); } +static void +clientEatRequestBodyHandler(char *buf, ssize_t size, void *data) +{ + clientHttpRequest *http = data; + ConnStateData *conn = http->conn; + if (buf && size < 0) { + return; /* Aborted, don't care */ + } + if (conn->body.size_left > 0) { + conn->body.callback = clientEatRequestBodyHandler; + conn->body.cbdata = http; + cbdataLock(conn->body.cbdata); + conn->body.buf = NULL; + conn->body.bufsize = SQUID_TCP_SO_RCVBUF; + clientProcessBody(conn); + } else { + if (http->request->flags.proxy_keepalive) { + debug(33, 5) ("clientWriteComplete: FD %d Keeping Alive\n", conn->fd); + clientKeepaliveNextRequest(http); + } else { + comm_close(conn->fd); + } + } +} + +static void +clientEatRequestBody(clientHttpRequest * http) +{ + ConnStateData *conn = http->conn; + cbdataLock(conn); + if (conn->body.request) + clientAbortBody(conn->body.request); + if (cbdataValid(conn)) + clientEatRequestBodyHandler(NULL, -1, http); + cbdataUnlock(conn); +} + /* Called by clientReadRequest to process body content */ static void clientProcessBody(ConnStateData * conn) @@ -3143,22 +3202,27 @@ clientProcessBody(ConnStateData * conn) void *cbdata = conn->body.cbdata; CBCB *callback = conn->body.callback; request_t *request = conn->body.request; - int valid; /* Note: request is null while eating "aborted" transfers */ debug(33, 2) ("clientProcessBody: start fd=%d body_size=%lu in.offset=%ld cb=%p req=%p\n", conn->fd, (unsigned long int) conn->body.size_left, (long int) conn->in.offset, callback, request); if (conn->in.offset) { + int valid = cbdataValid(conn->body.cbdata); + if (!valid) { + comm_close(conn->fd); + return; + } /* Some sanity checks... */ assert(conn->body.size_left > 0); assert(conn->in.offset > 0); assert(callback != NULL); - assert(buf != NULL); + assert(buf != NULL || !conn->body.request); /* How much do we have to process? */ size = conn->in.offset; if (size > conn->body.size_left) /* only process the body part */ size = conn->body.size_left; if (size > conn->body.bufsize) /* don't copy more than requested */ size = conn->body.bufsize; - xmemcpy(buf, conn->in.buf, size); + if (valid && buf) + xmemcpy(buf, conn->in.buf, size); conn->body.size_left -= size; /* Move any remaining data */ conn->in.offset -= size; @@ -3169,7 +3233,6 @@ clientProcessBody(ConnStateData * conn) if (conn->body.size_left <= 0 && request != NULL) request->body_connection = NULL; /* Remove clientReadBody arguments (the call is completed) */ - valid = cbdataValid(conn->body.cbdata); conn->body.request = NULL; conn->body.callback = NULL; cbdataUnlock(conn->body.cbdata); @@ -3188,25 +3251,8 @@ clientProcessBody(ConnStateData * conn) } } -/* A dummy handler that throws away a request-body */ -static char bodyAbortBuf[SQUID_TCP_SO_RCVBUF]; -static void -clientReadBodyAbortHandler(char *buf, ssize_t size, void *data) -{ - ConnStateData *conn = (ConnStateData *) data; - debug(33, 2) ("clientReadBodyAbortHandler: fd=%d body_size=%lu in.offset=%ld\n", conn->fd, (unsigned long int) conn->body.size_left, (long int) conn->in.offset); - if (size != 0 && conn->body.size_left != 0) { - debug(33, 3) ("clientReadBodyAbortHandler: fd=%d shedule next read\n", conn->fd); - conn->body.callback = clientReadBodyAbortHandler; - conn->body.buf = bodyAbortBuf; - conn->body.bufsize = sizeof(bodyAbortBuf); - conn->body.cbdata = data; - cbdataLock(conn->body.cbdata); - } -} - /* Abort a body request */ -int +void clientAbortBody(request_t * request) { ConnStateData *conn = request->body_connection; @@ -3215,26 +3261,23 @@ clientAbortBody(request_t * request) void *cbdata; int valid; request->body_connection = NULL; - if (!conn || conn->body.size_left <= 0) - return 0; /* No body to abort */ - if (conn->body.callback != NULL) { - buf = conn->body.buf; - callback = conn->body.callback; - cbdata = conn->body.cbdata; - valid = cbdataValid(cbdata); - assert(request == conn->body.request); - conn->body.buf = NULL; - conn->body.callback = NULL; - cbdataUnlock(conn->body.cbdata); - conn->body.cbdata = NULL; - conn->body.request = NULL; - if (valid) - callback(buf, -1, cbdata); /* Signal abort to clientReadBody caller */ - requestUnlink(request); - } - clientReadBodyAbortHandler(NULL, -1, conn); /* Install abort handler */ - /* clientProcessBody() */ - return 1; /* Aborted */ + if (!conn->body.callback || !conn->body.request) + return; + buf = conn->body.buf; + callback = conn->body.callback; + cbdata = conn->body.cbdata; + valid = cbdataValid(cbdata); + assert(request == conn->body.request); + conn->body.buf = NULL; + conn->body.callback = NULL; + cbdataUnlock(conn->body.cbdata); + conn->body.cbdata = NULL; + conn->body.request = NULL; + if (valid) + callback(buf, -1, cbdata); /* Signal abort to clientReadBody caller to allow them to clean up */ + else + debug(33, 1) ("NOTICE: A request body was aborted with cancelled callback: %p, possible memory leak\n", callback); + requestUnlink(request); /* Linked in clientReadBody */ } /* general lifetime handler for HTTP requests */ diff -rupN squid-2.5.STABLE3/src/delay_pools.c squid-2.5.STABLE4/src/delay_pools.c --- squid-2.5.STABLE3/src/delay_pools.c Sun Mar 9 11:41:27 2003 +++ squid-2.5.STABLE4/src/delay_pools.c Wed Jun 18 17:53:35 2003 @@ -1,6 +1,6 @@ /* - * $Id: delay_pools.c,v 1.19.2.7 2003/03/09 18:41:27 hno Exp $ + * $Id: delay_pools.c,v 1.19.2.8 2003/06/18 23:53:35 hno Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: David Luyer @@ -397,7 +397,6 @@ delayClient(clientHttpRequest * http) position |= 255; if (!(delay_data[pool].class3->individual_255_used[i / 8] & (1 << (i % 8)))) { delay_data[pool].class3->individual_255_used[i / 8] |= (1 << (i % 8)); - assert(position < C3_IND_SZ); delay_data[pool].class3->individual[position] = (int) (((double) Config.Delay.rates[pool]->individual.max_bytes * Config.Delay.initial) / 100); @@ -415,7 +414,6 @@ delayClient(clientHttpRequest * http) assert(j < (IND_MAP_SZ - 1)); delay_data[pool].class3->individual_map[i][j + 1] = 255; position |= j; - assert(position < C3_IND_SZ); delay_data[pool].class3->individual[position] = (int) (((double) Config.Delay.rates[pool]->individual.max_bytes * Config.Delay.initial) / 100); diff -rupN squid-2.5.STABLE3/src/errorpage.c squid-2.5.STABLE4/src/errorpage.c --- squid-2.5.STABLE3/src/errorpage.c Wed May 21 08:34:38 2003 +++ squid-2.5.STABLE4/src/errorpage.c Tue May 27 01:20:55 2003 @@ -1,6 +1,6 @@ /* - * $Id: errorpage.c,v 1.167.2.7 2003/05/21 14:34:38 hno Exp $ + * $Id: errorpage.c,v 1.167.2.8 2003/05/27 07:20:55 hno Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -223,7 +223,7 @@ errorPageId(const char *page_name) return i; } for (i = 0; i < ErrorDynamicPages.count; i++) { - if (strcmp(((ErrorDynamicPageInfo *) ErrorDynamicPages.items[i - ERR_MAX])->page_name, page_name) == 0) + if (strcmp(((ErrorDynamicPageInfo *) ErrorDynamicPages.items[i])->page_name, page_name) == 0) return i + ERR_MAX; } return ERR_NONE; diff -rupN squid-2.5.STABLE3/src/external_acl.c squid-2.5.STABLE4/src/external_acl.c --- squid-2.5.STABLE3/src/external_acl.c Sat May 17 12:35:25 2003 +++ squid-2.5.STABLE4/src/external_acl.c Tue Sep 2 01:51:59 2003 @@ -1,6 +1,6 @@ /* - * $Id: external_acl.c,v 1.1.2.25 2003/05/17 18:35:25 hno Exp $ + * $Id: external_acl.c,v 1.1.2.28 2003/09/02 07:51:59 hno Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -177,6 +177,8 @@ parse_externalAclHelper(external_acl ** a->ttl = atoi(token + 4); } else if (strncmp(token, "negative_ttl=", 13) == 0) { a->negative_ttl = atoi(token + 13); + } else if (strncmp(token, "children=", 9) == 0) { + a->children = atoi(token + 9); } else if (strncmp(token, "concurrency=", 12) == 0) { a->children = atoi(token + 12); } else if (strncmp(token, "cache=", 6) == 0) { @@ -417,6 +419,10 @@ aclMatchExternal(void *data, aclCheck_t } } key = makeExternalAclKey(ch, acl); + if (!key) { + /* Not sufficient data to process */ + return -1; + } ch->auth_user_request = NULL; if (entry) { if (entry->def != acl->def || strcmp(entry->hash.key, key) != 0) { @@ -507,7 +513,7 @@ makeExternalAclKey(aclCheck_t * ch, exte #if USE_IDENT case EXT_ACL_IDENT: str = ch->rfc931; - if (!str) { + if (!str || !*str) { ch->state[ACL_IDENT] = ACL_LOOKUP_NEEDED; return NULL; } diff -rupN squid-2.5.STABLE3/src/forward.c squid-2.5.STABLE4/src/forward.c --- squid-2.5.STABLE3/src/forward.c Mon Mar 17 11:34:19 2003 +++ squid-2.5.STABLE4/src/forward.c Wed Aug 6 07:49:01 2003 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.82.2.3 2003/03/17 18:34:19 hno Exp $ + * $Id: forward.c,v 1.82.2.4 2003/08/06 13:49:01 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -612,7 +612,6 @@ fwdStart(int fd, StoreEntry * e, request } debug(17, 3) ("fwdStart: '%s'\n", storeUrl(e)); e->mem_obj->request = requestLink(r); - e->mem_obj->fd = fd; #if URL_CHECKSUM_DEBUG assert(e->mem_obj->chksum == url_checksum(e->mem_obj->url)); #endif diff -rupN squid-2.5.STABLE3/src/fs/aufs/aiops.c squid-2.5.STABLE4/src/fs/aufs/aiops.c --- squid-2.5.STABLE3/src/fs/aufs/aiops.c Wed Jan 8 22:04:23 2003 +++ squid-2.5.STABLE4/src/fs/aufs/aiops.c Wed Aug 6 08:16:26 2003 @@ -1,5 +1,5 @@ /* - * $Id: aiops.c,v 1.12.2.7 2003/01/09 05:04:23 robertc Exp $ + * $Id: aiops.c,v 1.12.2.8 2003/08/06 14:16:26 hno Exp $ * * DEBUG: section 43 AIOPS * AUTHOR: Stewart Forster @@ -53,6 +53,14 @@ #define RIDICULOUS_LENGTH 4096 +#ifdef AUFS_IO_THREADS +int squidaio_nthreads = AUFS_IO_THREADS; +#else +int squidaio_nthreads = 0; +#endif +int squidaio_magic1 = 1; /* dummy initializer value */ +int squidaio_magic2 = 1; /* real value set in aiops.c */ + enum _squidaio_thread_status { _THREAD_STARTING = 0, _THREAD_WAITING, @@ -133,7 +141,6 @@ static void squidaio_poll_queues(void); static squidaio_thread_t *threads = NULL; static int squidaio_initialised = 0; - #define AIO_LARGE_BUFS 16384 #define AIO_MEDIUM_BUFS AIO_LARGE_BUFS >> 1 #define AIO_SMALL_BUFS AIO_LARGE_BUFS >> 2 @@ -309,7 +316,18 @@ squidaio_init(void) /* Create threads and get them to sit in their wait loop */ squidaio_thread_pool = memPoolCreate("aio_thread", sizeof(squidaio_thread_t)); - for (i = 0; i < NUMTHREADS; i++) { + if (squidaio_nthreads == 0) { + int j = 16; + for (i = 0; i < n_asyncufs_dirs; i++) { + squidaio_nthreads += j; + j = j * 2 / 3; + if (j < 4) + j = 4; + } + } + squidaio_magic1 = squidaio_nthreads * MAGIC1_FACTOR; + squidaio_magic2 = squidaio_nthreads * MAGIC2_FACTOR; + for (i = 0; i < squidaio_nthreads; i++) { threadp = memPoolAlloc(squidaio_thread_pool); threadp->status = _THREAD_STARTING; threadp->current_req = NULL; diff -rupN squid-2.5.STABLE3/src/fs/aufs/store_asyncufs.h squid-2.5.STABLE4/src/fs/aufs/store_asyncufs.h --- squid-2.5.STABLE3/src/fs/aufs/store_asyncufs.h Sat Nov 9 03:42:36 2002 +++ squid-2.5.STABLE4/src/fs/aufs/store_asyncufs.h Wed Aug 6 08:16:26 2003 @@ -7,16 +7,21 @@ #ifndef __STORE_ASYNCUFS_H__ #define __STORE_ASYNCUFS_H__ -#ifdef AUFS_IO_THREADS -#define NUMTHREADS AUFS_IO_THREADS -#else -#define NUMTHREADS (Config.cacheSwap.n_configured*16) -#endif +extern int n_asyncufs_dirs; +extern int squidaio_nthreads; +extern int squidaio_magic1; +extern int squidaio_magic2; + +/* Base number of threads if not specified to configure. + * Weighted by number of directories (see aiops.c) */ +#define THREAD_FACTOR 16 /* Queue limit where swapouts are deferred (load calculation) */ -#define MAGIC1 (NUMTHREADS*Config.cacheSwap.n_configured*5) +#define MAGIC1_FACTOR 10 +#define MAGIC1 squidaio_magic1 /* Queue limit where swapins are deferred (open/create fails) */ -#define MAGIC2 (NUMTHREADS*Config.cacheSwap.n_configured*20) +#define MAGIC2_FACTOR 20 +#define MAGIC2 squidaio_magic2 /* Which operations to run async */ #define ASYNC_OPEN 1 diff -rupN squid-2.5.STABLE3/src/fs/aufs/store_dir_aufs.c squid-2.5.STABLE4/src/fs/aufs/store_dir_aufs.c --- squid-2.5.STABLE3/src/fs/aufs/store_dir_aufs.c Wed Jan 8 20:38:38 2003 +++ squid-2.5.STABLE4/src/fs/aufs/store_dir_aufs.c Wed Aug 6 08:16:26 2003 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_aufs.c,v 1.40.2.7 2003/01/09 03:38:38 hno Exp $ + * $Id: store_dir_aufs.c,v 1.40.2.8 2003/08/06 14:16:26 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -64,7 +64,7 @@ struct _RebuildState { struct _store_rebuild_data counts; }; -static int n_asyncufs_dirs = 0; +int n_asyncufs_dirs = 0; static int *asyncufs_dir_index = NULL; MemPool *squidaio_state_pool = NULL; MemPool *aufs_qread_pool = NULL; diff -rupN squid-2.5.STABLE3/src/fs/aufs/store_io_aufs.c squid-2.5.STABLE4/src/fs/aufs/store_io_aufs.c --- squid-2.5.STABLE3/src/fs/aufs/store_io_aufs.c Thu Nov 14 23:33:25 2002 +++ squid-2.5.STABLE4/src/fs/aufs/store_io_aufs.c Mon Jul 21 16:34:53 2003 @@ -66,6 +66,7 @@ storeAufsOpen(SwapDir * SD, StoreEntry * sio->e = e; cbdataLock(callback_data); Opening_FD++; + statCounter.syscalls.disk.opens++; #if ASYNC_OPEN aioOpen(path, O_RDONLY | O_BINARY, 0644, storeAufsOpenDone, sio); #else @@ -120,6 +121,7 @@ storeAufsCreate(SwapDir * SD, StoreEntry sio->e = (StoreEntry *) e; cbdataLock(callback_data); Opening_FD++; + statCounter.syscalls.disk.opens++; #if ASYNC_CREATE aioOpen(path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644, storeAufsOpenDone, sio); #else @@ -182,8 +184,10 @@ storeAufsRead(SwapDir * SD, storeIOState aiostate->flags.reading = 1; #if ASYNC_READ aioRead(aiostate->fd, offset, size, storeAufsReadDone, sio); + statCounter.syscalls.disk.reads++; #else file_read(aiostate->fd, buf, size, offset, storeAufsReadDone, sio); + /* file_read() increments syscalls.disk.reads */ #endif } @@ -222,9 +226,11 @@ storeAufsWrite(SwapDir * SD, storeIOStat aiostate->flags.writing = 1; aioWrite(aiostate->fd, offset, buf, size, storeAufsWriteDone, sio, free_func); + statCounter.syscalls.disk.writes++; #else file_write(aiostate->fd, offset, buf, size, storeAufsWriteDone, sio, free_func); + /* file_write() increments syscalls.disk.writes */ #endif } @@ -236,6 +242,7 @@ storeAufsUnlink(SwapDir * SD, StoreEntry storeAufsDirReplRemove(e); storeAufsDirMapBitReset(SD, e->swap_filen); storeAufsDirUnlinkFile(SD, e->swap_filen); + statCounter.syscalls.disk.unlinks++; } /* === STATIC =========================================================== */ @@ -419,15 +426,16 @@ storeAufsIOCallback(storeIOState * sio, debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); cbdataUnlock(their_data); aiostate->fd = -1; - cbdataFree(sio); if (aiostate->flags.opening) Opening_FD--; + cbdataFree(sio); if (fd < 0) return; debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); aioClose(fd); fd_close(fd); store_open_disk_fd--; + statCounter.syscalls.disk.closes++; debug(79, 9) ("%s:%d\n", __FILE__, __LINE__); } diff -rupN squid-2.5.STABLE3/src/fs/coss/async_io.c squid-2.5.STABLE4/src/fs/coss/async_io.c --- squid-2.5.STABLE3/src/fs/coss/async_io.c Sat Jul 20 18:30:03 2002 +++ squid-2.5.STABLE4/src/fs/coss/async_io.c Tue Jul 29 15:44:47 2003 @@ -11,7 +11,7 @@ * supports are read/write, and since COSS works on a single file * per storedir it should work just fine. * - * $Id: async_io.c,v 1.7.2.1 2002/07/21 00:30:03 hno Exp $ + * $Id: async_io.c,v 1.7.2.4 2003/07/29 21:44:47 wessels Exp $ */ #include "squid.h" @@ -62,14 +62,14 @@ a_file_read(async_queue_t * q, int fd, v assert(q->aq_state == AQ_STATE_SETUP); -#if 0 - file_read(fd, buf, req_len, offset, callback, data); -#endif /* Find a free slot */ slot = a_file_findslot(q); if (slot < 0) { /* No free slot? Callback error, and return */ - fatal("Aiee! out of aiocb slots!\n"); + debug(79, 1) ("WARNING: out of aiocb slots!\n"); + /* fall back to blocking method */ + file_read(fd, buf, req_len, offset, callback, data); + return; } /* Mark slot as ours */ qe = &q->aq_queue[slot]; @@ -94,7 +94,9 @@ a_file_read(async_queue_t * q, int fd, v /* Initiate aio */ if (aio_read(&qe->aq_e_aiocb) < 0) { - fatalf("Aiee! aio_read() returned error (%d)!\n", errno); + debug(79, 1) ("WARNING: aio_read() returned error: %s\n", xstrerror()); + /* fall back to blocking method */ + file_read(fd, buf, req_len, offset, callback, data); } } @@ -108,14 +110,14 @@ a_file_write(async_queue_t * q, int fd, assert(q->aq_state == AQ_STATE_SETUP); -#if 0 - file_write(fd, offset, buf, len, callback, data, freefunc); -#endif /* Find a free slot */ slot = a_file_findslot(q); if (slot < 0) { /* No free slot? Callback error, and return */ - fatal("Aiee! out of aiocb slots!\n"); + debug(79, 1) ("WARNING: out of aiocb slots!\n"); + /* fall back to blocking method */ + file_write(fd, offset, buf, len, callback, data, freefunc); + return; } /* Mark slot as ours */ qe = &q->aq_queue[slot]; @@ -140,7 +142,9 @@ a_file_write(async_queue_t * q, int fd, /* Initiate aio */ if (aio_write(&qe->aq_e_aiocb) < 0) { - fatalf("Aiee! aio_read() returned error (%d)!\n", errno); + debug(79, 1) ("WARNING: aio_write() returned error: %s\n", xstrerror()); + /* fall back to blocking method */ + file_write(fd, offset, buf, len, callback, data, freefunc); } } diff -rupN squid-2.5.STABLE3/src/fs/coss/coss-notes.txt squid-2.5.STABLE4/src/fs/coss/coss-notes.txt --- squid-2.5.STABLE3/src/fs/coss/coss-notes.txt Wed Sep 19 07:23:30 2001 +++ squid-2.5.STABLE4/src/fs/coss/coss-notes.txt Wed Jul 23 15:00:33 2003 @@ -2,7 +2,7 @@ COSS notes Adrian Chadd -$Id: coss-notes.txt,v 1.1 2001/09/19 13:23:30 adrian Exp $ +$Id: coss-notes.txt,v 1.1.2.1 2003/07/23 21:00:33 wessels Exp $ COSS is a Cyclic Object storage system originally designed by @@ -89,3 +89,35 @@ well in the current squid codebase, but planned rewrite. This would also allow alternate replacement policies to be used. Oh, it'd cut down the storage requirements per StoreEntry by two pointers (8 bytes on the i386.) + +Notes by DW July 23, 2003 +------------------------- + +Fixed up swap_filen -> offset implementation. Now user can use a +block-size setting to determine the maximum COSS cache_dir size. + +Fixed bug when cached response is larger than COSS stripe size. +Now require max-size to be less than COSS_MEMBUF_SZ. + +Fixed a lockcount bug. Some aborted requests for cache hits failed +to unlock the CossMemBuf because storeCossReadDone isn't called again. +Solution is to add locked_membuf pointer to CossState structure and +always unlock it if set. This is probably more reliable than +unlocking based on diskstart/diskend offsets. + +I'm worried that COSS is susceptible to a denial-of-service. If +the user can create N cache misses for responses about as large as +COSS_MEMBUF_SZ, then COSS probably allocates N membufs (stripes) +at the same time. For large enough values of N, this should cause +a malloc failure. Solution may be to refuse to allocate new stripes +(thus returning failure for cache misses and hits) after so many +have already been allocated. + +Adrian's code has this comment: + + /* Since we're not supporting NOTIFY anymore, lets fail */ + assert(which != COSS_ALLOC_NOTIFY); + +However, COSS_ALLOC_NOTIFY was still present in the store_dir_coss.c +rebuild routines. To avoid assertions during rebuild, I commented +out the storeCossAllocate(SD, e, COSS_ALLOC_NOTIFY) call. diff -rupN squid-2.5.STABLE3/src/fs/coss/store_coss.h squid-2.5.STABLE4/src/fs/coss/store_coss.h --- squid-2.5.STABLE3/src/fs/coss/store_coss.h Sun Aug 12 04:20:41 2001 +++ squid-2.5.STABLE4/src/fs/coss/store_coss.h Wed Aug 13 10:01:29 2003 @@ -5,14 +5,6 @@ #define COSS_MEMBUF_SZ 1048576 #endif -#ifndef COSS_BLOCK_SZ -#define COSS_BLOCK_SZ 512 -#endif - -/* Macros to help block<->offset transiting */ -#define COSS_OFS_TO_BLK(ofs) ((ofs) / COSS_BLOCK_SZ) -#define COSS_BLK_TO_OFS(ofs) ((ofs) * COSS_BLOCK_SZ) - /* Note that swap_filen in sio/e are actually disk offsets too! */ /* What we're doing in storeCossAllocate() */ @@ -20,10 +12,29 @@ #define COSS_ALLOC_ALLOCATE 1 #define COSS_ALLOC_REALLOC 2 +struct _coss_stats { + int stripes; + struct { + int alloc; + int realloc; + int collisions; + } alloc; + int disk_overflows; + int stripe_overflows; + int open_mem_hits; + int open_mem_misses; + struct { + int ops; + int success; + int fail; + } open, create, close, unlink, read, write, stripe_write; +}; + + struct _cossmembuf { dlink_node node; - size_t diskstart; /* in blocks */ - size_t diskend; /* in blocks */ + size_t diskstart; /* in bytes */ + size_t diskend; /* in bytes */ SwapDir *SD; int lockcount; char buffer[COSS_MEMBUF_SZ]; @@ -38,7 +49,7 @@ struct _cossmembuf { struct _cossinfo { dlink_list membufs; struct _cossmembuf *current_membuf; - size_t current_offset; /* in Blocks */ + size_t current_offset; /* in bytes */ int fd; int swaplog_fd; int numcollisions; @@ -46,6 +57,8 @@ struct _cossinfo { int count; async_queue_t aq; dlink_node *walk_current; + unsigned int blksz_bits; + unsigned int blksz_mask; /* just 1<fd = file_open(sd->path, O_RDWR | O_CREAT); if (cs->fd < 0) { debug(79, 1) ("%s: %s\n", sd->path, xstrerror()); - fatal("storeCossDirInit: Failed to open a COSS directory."); + fatal("storeCossDirInit: Failed to open a COSS file."); } n_coss_dirs++; - (void) storeDirGetBlkSize(sd->path, &sd->fs.blksize); + /* + * fs.blksize is normally determined by calling statvfs() etc, + * but we just set it here. It is used in accounting the + * total store size, and is reported in cachemgr 'storedir' + * page. + */ + sd->fs.blksize = 1 << cs->blksz_bits; } void @@ -335,7 +352,10 @@ storeCossAddDiskRestore(SwapDir * SD, co EBIT_CLR(e->flags, ENTRY_VALIDATED); storeHashInsert(e, key); /* do it after we clear KEY_PRIVATE */ storeCossAdd(SD, e); +#if USE_COSS_ALLOC_NOTIFY e->swap_filen = storeCossAllocate(SD, e, COSS_ALLOC_NOTIFY); +#endif + assert(e->swap_filen >= 0); return e; } @@ -742,6 +762,7 @@ storeCossDirParse(SwapDir * sd, int inde unsigned int i; unsigned int size; CossInfo *cs; + off_t max_offset; i = GetInteger(); size = i << 10; /* Mbytes to Kbytes */ @@ -796,11 +817,27 @@ storeCossDirParse(SwapDir * sd, int inde cs->current_membuf = NULL; cs->index.head = NULL; cs->index.tail = NULL; + cs->blksz_bits = 9; /* default block size = 512 */ + cs->blksz_mask = (1 << cs->blksz_bits) - 1; - parse_cachedir_options(sd, NULL, 0); + parse_cachedir_options(sd, options, 0); /* Enforce maxobjsize being set to something */ if (sd->max_objsize == -1) fatal("COSS requires max-size to be set to something other than -1!\n"); + if (sd->max_objsize > COSS_MEMBUF_SZ) + fatalf("COSS max-size option must be less than COSS_MEMBUF_SZ (%d)\n", COSS_MEMBUF_SZ); + /* + * check that we won't overflow sfileno later. 0xFFFFFF is the + * largest possible sfileno, assuming sfileno is a 25-bit + * signed integer, as defined in structs.h. + */ + max_offset = (off_t) 0xFFFFFF << cs->blksz_bits; + if (sd->max_size > (unsigned long) (max_offset >> 10)) { + debug(47, 0) ("COSS block-size = %d bytes\n", 1 << cs->blksz_bits); + debug(47, 0) ("COSS largest file offset = %lu KB\n", (unsigned long) max_offset >> 10); + debug(47, 0) ("COSS cache_dir size = %d KB\n", sd->max_size); + fatal("COSS cache_dir size exceeds largest offset\n"); + } } @@ -821,7 +858,7 @@ storeCossDirReconfigure(SwapDir * sd, in debug(3, 1) ("Cache COSS dir '%s' size changed to %d KB\n", path, size); sd->max_size = size; } - parse_cachedir_options(sd, NULL, 1); + parse_cachedir_options(sd, options, 1); /* Enforce maxobjsize being set to something */ if (sd->max_objsize == -1) fatal("COSS requires max-size to be set to something other than -1!\n"); @@ -835,6 +872,42 @@ storeCossDirDump(StoreEntry * entry, Swa dump_cachedir_options(entry, NULL, s); } +static void +storeCossDirParseBlkSize(SwapDir * sd, const char *name, const char *value, int reconfiguring) +{ + CossInfo *cs = sd->fsdata; + int blksz = atoi(value); + int check; + int nbits; + if (blksz == (1 << cs->blksz_bits)) + /* no change */ + return; + if (reconfiguring) { + debug(47, 0) ("WARNING: cannot change COSS block-size while Squid is running\n"); + return; + } + nbits = 0; + check = blksz; + while (check > 1) { + nbits++; + check >>= 1; + } + check = 1 << nbits; + if (check != blksz) + fatal("COSS block-size must be a power of 2\n"); + if (nbits > 13) + fatal("COSS block-size must be 8192 or smaller\n"); + cs->blksz_bits = nbits; + cs->blksz_mask = (1 << cs->blksz_bits) - 1; +} + +static void +storeCossDirDumpBlkSize(StoreEntry * e, const char *option, SwapDir * sd) +{ + CossInfo *cs = sd->fsdata; + storeAppendPrintf(e, " block-size=%d", 1 << cs->blksz_bits); +} + #if OLD_UNUSED_CODE SwapDir * storeCossDirPick(void) @@ -886,6 +959,37 @@ storeCossDirDone(void) coss_initialised = 0; } +static void +storeCossStats(StoreEntry * sentry) +{ + const char *tbl_fmt = "%10s %10d %10d %10d\n"; + storeAppendPrintf(sentry, "\n OPS SUCCESS FAIL\n"); + storeAppendPrintf(sentry, tbl_fmt, + "open", coss_stats.open.ops, coss_stats.open.success, coss_stats.open.fail); + storeAppendPrintf(sentry, tbl_fmt, + "create", coss_stats.create.ops, coss_stats.create.success, coss_stats.create.fail); + storeAppendPrintf(sentry, tbl_fmt, + "close", coss_stats.close.ops, coss_stats.close.success, coss_stats.close.fail); + storeAppendPrintf(sentry, tbl_fmt, + "unlink", coss_stats.unlink.ops, coss_stats.unlink.success, coss_stats.unlink.fail); + storeAppendPrintf(sentry, tbl_fmt, + "read", coss_stats.read.ops, coss_stats.read.success, coss_stats.read.fail); + storeAppendPrintf(sentry, tbl_fmt, + "write", coss_stats.write.ops, coss_stats.write.success, coss_stats.write.fail); + storeAppendPrintf(sentry, tbl_fmt, + "s_write", coss_stats.stripe_write.ops, coss_stats.stripe_write.success, coss_stats.stripe_write.fail); + + storeAppendPrintf(sentry, "\n"); + storeAppendPrintf(sentry, "stripes: %d\n", coss_stats.stripes); + storeAppendPrintf(sentry, "alloc.alloc: %d\n", coss_stats.alloc.alloc); + storeAppendPrintf(sentry, "alloc.realloc: %d\n", coss_stats.alloc.realloc); + storeAppendPrintf(sentry, "alloc.collisions: %d\n", coss_stats.alloc.collisions); + storeAppendPrintf(sentry, "disk_overflows: %d\n", coss_stats.disk_overflows); + storeAppendPrintf(sentry, "stripe_overflows: %d\n", coss_stats.stripe_overflows); + storeAppendPrintf(sentry, "open_mem_hits: %d\n", coss_stats.open_mem_hits); + storeAppendPrintf(sentry, "open_mem_misses: %d\n", coss_stats.open_mem_misses); +} + void storeFsSetup_coss(storefs_entry_t * storefs) { @@ -896,5 +1000,6 @@ storeFsSetup_coss(storefs_entry_t * stor storefs->donefunc = storeCossDirDone; coss_state_pool = memPoolCreate("COSS IO State data", sizeof(CossState)); coss_index_pool = memPoolCreate("COSS index data", sizeof(CossIndexNode)); + cachemgrRegister("coss", "COSS Stats", storeCossStats, 0, 1); coss_initialised = 1; } diff -rupN squid-2.5.STABLE3/src/fs/coss/store_io_coss.c squid-2.5.STABLE4/src/fs/coss/store_io_coss.c --- squid-2.5.STABLE3/src/fs/coss/store_io_coss.c Thu Aug 8 14:17:41 2002 +++ squid-2.5.STABLE4/src/fs/coss/store_io_coss.c Tue Jul 29 16:19:43 2003 @@ -1,6 +1,6 @@ /* - * $Id: store_io_coss.c,v 1.13.2.4 2002/08/08 20:17:41 hno Exp $ + * $Id: store_io_coss.c,v 1.13.2.8 2003/07/29 22:19:43 wessels Exp $ * * DEBUG: section 79 Storage Manager COSS Interface * AUTHOR: Eric Stern @@ -49,6 +49,11 @@ static void storeCossWriteMemBufDone(int static CossMemBuf *storeCossCreateMemBuf(SwapDir * SD, size_t start, sfileno curfn, int *collision); static CBDUNL storeCossIOFreeEntry; +static off_t storeCossFilenoToDiskOffset(sfileno f, CossInfo *); +static sfileno storeCossDiskOffsetToFileno(off_t o, CossInfo *); +static void storeCossMaybeWriteMemBuf(SwapDir * SD, CossMemBuf * t); + +static void membuf_describe(CossMemBuf * t, int level, int line); CBDATA_TYPE(storeIOState); CBDATA_TYPE(CossMemBuf); @@ -62,7 +67,7 @@ CBDATA_TYPE(CossMemBuf); * to work.. * -- Adrian */ -off_t +static sfileno storeCossAllocate(SwapDir * SD, const StoreEntry * e, int which) { CossInfo *cs = (CossInfo *) SD->fsdata; @@ -73,12 +78,13 @@ storeCossAllocate(SwapDir * SD, const St sfileno checkf; /* Make sure we chcek collisions if reallocating */ - if (which == COSS_ALLOC_REALLOC) + if (which == COSS_ALLOC_REALLOC) { checkf = e->swap_filen; - else + coss_stats.alloc.realloc++; + } else { checkf = -1; - - retofs = e->swap_filen; /* Just for defaults, or while rebuilding */ + coss_stats.alloc.alloc++; + } if (e->swap_file_sz > 0) allocsize = e->swap_file_sz; @@ -89,13 +95,15 @@ storeCossAllocate(SwapDir * SD, const St assert(which != COSS_ALLOC_NOTIFY); /* Check if we have overflowed the disk .. */ - if ((cs->current_offset + allocsize) > (SD->max_size << 10)) { + if ((cs->current_offset + allocsize) > ((off_t) SD->max_size << 10)) { /* * tried to allocate past the end of the disk, so wrap * back to the beginning */ + coss_stats.disk_overflows++; cs->current_membuf->flags.full = 1; - cs->current_membuf->diskend = cs->current_offset - 1; + cs->current_membuf->diskend = cs->current_offset; + storeCossMaybeWriteMemBuf(SD, cs->current_membuf); cs->current_offset = 0; /* wrap back to beginning */ debug(79, 2) ("storeCossAllocate: wrap to 0\n"); @@ -103,12 +111,14 @@ storeCossAllocate(SwapDir * SD, const St cs->current_membuf = newmb; /* Check if we have overflowed the MemBuf */ - } else if ((cs->current_offset + allocsize) > cs->current_membuf->diskend) { + } else if ((cs->current_offset + allocsize) >= cs->current_membuf->diskend) { /* * Skip the blank space at the end of the stripe. start over. */ + coss_stats.stripe_overflows++; cs->current_membuf->flags.full = 1; - cs->current_offset = cs->current_membuf->diskend + 1; + cs->current_offset = cs->current_membuf->diskend; + storeCossMaybeWriteMemBuf(SD, cs->current_membuf); debug(79, 2) ("storeCossAllocate: New offset - %ld\n", (long int) cs->current_offset); newmb = storeCossCreateMemBuf(SD, cs->current_offset, checkf, &coll); @@ -118,8 +128,11 @@ storeCossAllocate(SwapDir * SD, const St if (coll == 0) { retofs = cs->current_offset; cs->current_offset = retofs + allocsize; - return retofs; + /* round up to our blocksize */ + cs->current_offset = ((cs->current_offset + cs->blksz_mask) >> cs->blksz_bits) << cs->blksz_bits; + return storeCossDiskOffsetToFileno(retofs, cs); } else { + coss_stats.alloc.collisions++; debug(79, 3) ("storeCossAllocate: Collision\n"); return -1; } @@ -129,6 +142,8 @@ void storeCossUnlink(SwapDir * SD, StoreEntry * e) { debug(79, 3) ("storeCossUnlink: offset %d\n", e->swap_filen); + coss_stats.unlink.ops++; + coss_stats.unlink.success++; storeCossRemove(SD, e); } @@ -139,7 +154,7 @@ storeCossCreate(SwapDir * SD, StoreEntry CossState *cstate; storeIOState *sio; - CBDATA_INIT_TYPE_FREECB(storeIOState, storeCossIOFreeEntry); + coss_stats.create.ops++; sio = cbdataAlloc(storeIOState); cstate = memPoolAlloc(coss_state_pool); sio->fsstate = cstate; @@ -159,7 +174,11 @@ storeCossCreate(SwapDir * SD, StoreEntry sio->st_size = objectLen(e) + e->mem_obj->swap_hdr_sz; sio->swap_dirn = SD->index; sio->swap_filen = storeCossAllocate(SD, e, COSS_ALLOC_ALLOCATE); - debug(79, 3) ("storeCossCreate: offset %d, size %ld, end %ld\n", sio->swap_filen, (long int) sio->st_size, (long int) (sio->swap_filen + sio->st_size)); + debug(79, 3) ("storeCossCreate: offset %ld, size %ld, end %ld\n", + (long int) storeCossFilenoToDiskOffset(sio->swap_filen, SD->fsdata), + (long int) sio->st_size, + (long int) (sio->swap_filen + sio->st_size)); + assert(-1 != sio->swap_filen); sio->callback = callback; sio->file_callback = file_callback; @@ -176,6 +195,7 @@ storeCossCreate(SwapDir * SD, StoreEntry storeCossAdd(SD, e); storeCossMemBufLock(SD, sio); + coss_stats.create.success++; return sio; } @@ -190,8 +210,8 @@ storeCossOpen(SwapDir * SD, StoreEntry * CossInfo *cs = (CossInfo *) SD->fsdata; debug(79, 3) ("storeCossOpen: offset %d\n", f); + coss_stats.open.ops++; - CBDATA_INIT_TYPE_FREECB(storeIOState, storeCossIOFreeEntry); sio = cbdataAlloc(storeIOState); cstate = memPoolAlloc(coss_state_pool); @@ -211,27 +231,29 @@ storeCossOpen(SwapDir * SD, StoreEntry * cstate->flags.reading = 0; cstate->readbuffer = NULL; cstate->reqdiskoffset = -1; - p = storeCossMemPointerFromDiskOffset(SD, f, NULL); + p = storeCossMemPointerFromDiskOffset(SD, storeCossFilenoToDiskOffset(f, cs), NULL); /* make local copy so we don't have to lock membuf */ if (p) { cstate->readbuffer = xmalloc(sio->st_size); xmemcpy(cstate->readbuffer, p, sio->st_size); + coss_stats.open_mem_hits++; } else { /* Do the allocation */ /* this is the first time we've been called on a new sio * read the whole object into memory, then return the * requested amount */ + coss_stats.open_mem_misses++; /* * This bit of code actually does the LRU disk thing - we realloc * a place for the object here, and the file_read() reads the object * into the cossmembuf for later writing .. */ - cstate->reqdiskoffset = sio->swap_filen; - sio->swap_filen = -1; + cstate->reqdiskoffset = storeCossFilenoToDiskOffset(sio->swap_filen, cs); sio->swap_filen = storeCossAllocate(SD, e, COSS_ALLOC_REALLOC); if (sio->swap_filen == -1) { /* We have to clean up neatly .. */ + coss_stats.open.fail++; cbdataFree(sio); cs->numcollisions++; debug(79, 2) ("storeCossOpen: Reallocation of %d/%d failed\n", e->swap_dirn, e->swap_filen); @@ -243,7 +265,7 @@ storeCossOpen(SwapDir * SD, StoreEntry * /* * lock the buffer so it doesn't get swapped out on us - * this will get unlocked in storeCossReadDone + * this will get unlocked in storeCossClose */ storeCossMemBufLock(SD, sio); @@ -254,11 +276,12 @@ storeCossOpen(SwapDir * SD, StoreEntry * storeCossAdd(SD, e); /* - * Since we've reallocated a spot for this object, we need to - * write it to the cossmembuf *and* return it in the read .. + * NOTE cstate->readbuffer is NULL. We'll actually read + * the disk data into the MemBuf in storeCossRead() and + * return that pointer back to the caller */ - cstate->readbuffer = NULL; } + coss_stats.open.success++; return sio; } @@ -266,8 +289,9 @@ void storeCossClose(SwapDir * SD, storeIOState * sio) { debug(79, 3) ("storeCossClose: offset %d\n", sio->swap_filen); - if (FILE_MODE(sio->mode) == O_WRONLY) - storeCossMemBufUnlock(SD, sio); + coss_stats.close.ops++; + coss_stats.close.success++; + storeCossMemBufUnlock(SD, sio); storeCossIOCallback(sio, 0); } @@ -278,6 +302,7 @@ storeCossRead(SwapDir * SD, storeIOState CossState *cstate = (CossState *) sio->fsstate; CossInfo *cs = (CossInfo *) SD->fsdata; + coss_stats.read.ops++; assert(sio->read.callback == NULL); assert(sio->read.callback_data == NULL); sio->read.callback = callback; @@ -291,8 +316,7 @@ storeCossRead(SwapDir * SD, storeIOState cstate->requestbuf = buf; cstate->requestoffset = offset; if (cstate->readbuffer == NULL) { - p = storeCossMemPointerFromDiskOffset(SD, sio->swap_filen, NULL); - /* Remember we need to translate the block offset to a disk offset! */ + p = storeCossMemPointerFromDiskOffset(SD, storeCossFilenoToDiskOffset(sio->swap_filen, cs), NULL); a_file_read(&cs->aq, cs->fd, p, sio->st_size, @@ -301,6 +325,9 @@ storeCossRead(SwapDir * SD, storeIOState sio); cstate->reqdiskoffset = 0; /* XXX */ } else { + /* + * It was copied from memory in storeCossOpen() + */ storeCossReadDone(cs->fd, cstate->readbuffer, sio->st_size, @@ -321,15 +348,17 @@ storeCossWrite(SwapDir * SD, storeIOStat * the squid code is broken */ assert(sio->e->mem_obj->object_sz != -1); + coss_stats.write.ops++; debug(79, 3) ("storeCossWrite: offset %ld, len %lu\n", (long int) sio->offset, (unsigned long int) size); - diskoffset = sio->swap_filen + sio->offset; + diskoffset = storeCossFilenoToDiskOffset(sio->swap_filen, SD->fsdata) + sio->offset; dest = storeCossMemPointerFromDiskOffset(SD, diskoffset, &membuf); assert(dest != NULL); xmemcpy(dest, buf, size); sio->offset += size; if (free_func) (free_func) (buf); + coss_stats.write.success++; } @@ -350,14 +379,22 @@ storeCossReadDone(int fd, const char *bu sio->swap_filen, fd, len); cstate->flags.reading = 0; if (errflag) { - debug(79, 3) ("storeCossReadDone: got failure (%d)\n", errflag); + coss_stats.read.fail++; + if (errflag > 0) { + errno = errflag; + debug(79, 1) ("storeCossReadDone: error: %s\n", xstrerror()); + } else { + debug(79, 1) ("storeCossReadDone: got failure (%d)\n", errflag); + } rlen = -1; } else { + coss_stats.read.success++; if (cstate->readbuffer == NULL) { cstate->readbuffer = xmalloc(sio->st_size); - p = storeCossMemPointerFromDiskOffset(SD, sio->swap_filen, NULL); + p = storeCossMemPointerFromDiskOffset(SD, + storeCossFilenoToDiskOffset(sio->swap_filen, SD->fsdata), + NULL); xmemcpy(cstate->readbuffer, p, sio->st_size); - storeCossMemBufUnlock(SD, sio); } sio->offset += len; xmemcpy(cstate->requestbuf, &cstate->readbuffer[cstate->requestoffset], @@ -377,6 +414,7 @@ storeCossIOCallback(storeIOState * sio, { CossState *cstate = (CossState *) sio->fsstate; debug(79, 3) ("storeCossIOCallback: errflag=%d\n", errflag); + assert(NULL == cstate->locked_membuf); xfree(cstate->readbuffer); if (cbdataValid(sio->callback_data)) sio->callback(sio->callback_data, errflag, sio); @@ -394,7 +432,7 @@ storeCossMemPointerFromDiskOffset(SwapDi for (m = cs->membufs.head; m; m = m->next) { t = m->data; - if ((offset >= t->diskstart) && (offset <= t->diskend)) { + if ((offset >= t->diskstart) && (offset < t->diskend)) { if (mb) *mb = t; return &t->buffer[offset - t->diskstart]; @@ -406,53 +444,65 @@ storeCossMemPointerFromDiskOffset(SwapDi return NULL; } -static void -storeCossMemBufLock(SwapDir * SD, storeIOState * e) +static CossMemBuf * +storeCossFilenoToMembuf(SwapDir * SD, sfileno s) { - CossMemBuf *t; + CossMemBuf *t = NULL; dlink_node *m; CossInfo *cs = (CossInfo *) SD->fsdata; - + off_t o = storeCossFilenoToDiskOffset(s, cs); for (m = cs->membufs.head; m; m = m->next) { t = m->data; - if ((e->swap_filen >= t->diskstart) && (e->swap_filen <= t->diskend)) { - debug(79, 3) ("storeCossMemBufLock: locking %p, lockcount %d\n", t, t->lockcount); - t->lockcount++; - return; - } + if ((o >= t->diskstart) && (o < t->diskend)) + break; } - debug(79, 3) ("storeCossMemBufLock: FAILED to lock %p\n", e); + assert(t); + return t; } static void -storeCossMemBufUnlock(SwapDir * SD, storeIOState * e) +storeCossMemBufLock(SwapDir * SD, storeIOState * sio) { - CossMemBuf *t; - dlink_node *m, *n; - CossInfo *cs = (CossInfo *) SD->fsdata; + CossMemBuf *t = storeCossFilenoToMembuf(SD, sio->swap_filen); + CossState *cstate = (CossState *) sio->fsstate; + debug(79, 3) ("storeCossMemBufLock: locking %p, lockcount %d\n", + t, t->lockcount); + cstate->locked_membuf = t; + t->lockcount++; +} - for (m = cs->membufs.head; m; m = n) { - /* - * Note that storeCossWriteMemBuf() might call storeCossWriteMemBufDone - * immediately (if the write finishes immediately, of course!) which - * will make m = m->next kinda unworkable. So, get the next pointer. - */ - n = m->next; - t = m->data; - if ((e->swap_filen >= t->diskstart) && (e->swap_filen <= t->diskend)) { - t->lockcount--; - debug(79, 3) ("storeCossMemBufUnlock: unlocking %p, lockcount %d\n", t, t->lockcount); - } - if (t->flags.full && !t->flags.writing && !t->lockcount) - storeCossWriteMemBuf(SD, t); - } +static void +storeCossMemBufUnlock(SwapDir * SD, storeIOState * sio) +{ + CossState *cstate = (CossState *) sio->fsstate; + CossMemBuf *t = cstate->locked_membuf; + if (NULL == t) + return; + debug(79, 3) ("storeCossMemBufUnlock: unlocking %p, lockcount %d\n", + t, t->lockcount); + t->lockcount--; + cstate->locked_membuf = NULL; + storeCossMaybeWriteMemBuf(SD, t); +} + +static void +storeCossMaybeWriteMemBuf(SwapDir * SD, CossMemBuf * t) +{ + membuf_describe(t, 3, __LINE__); + if (!t->flags.full) + debug(79, 3) ("membuf %p not full\n", t); + else if (t->flags.writing) + debug(79, 3) ("membuf %p writing\n", t); + else if (t->lockcount) + debug(79, 3) ("membuf %p lockcount=%d\n", t, t->lockcount); + else + storeCossWriteMemBuf(SD, t); } void storeCossSync(SwapDir * SD) { CossInfo *cs = (CossInfo *) SD->fsdata; - CossMemBuf *t; dlink_node *m; int end; @@ -463,9 +513,11 @@ storeCossSync(SwapDir * SD) if (!cs->membufs.head) return; for (m = cs->membufs.head; m; m = m->next) { - t = m->data; - if (t->flags.writing) + CossMemBuf *t = m->data; + if (t->flags.writing) { + debug(79, 1) ("WARNING: sleeping for 5 seconds in storeCossSync()\n"); sleep(5); /* XXX EEEWWW! */ + } lseek(cs->fd, t->diskstart, SEEK_SET); end = (t == cs->current_membuf) ? cs->current_offset : t->diskend; FD_WRITE_METHOD(cs->fd, t->buffer, end - t->diskstart); @@ -476,10 +528,10 @@ static void storeCossWriteMemBuf(SwapDir * SD, CossMemBuf * t) { CossInfo *cs = (CossInfo *) SD->fsdata; + coss_stats.stripe_write.ops++; debug(79, 3) ("storeCossWriteMemBuf: offset %ld, len %ld\n", (long int) t->diskstart, (long int) (t->diskend - t->diskstart)); t->flags.writing = 1; - /* Remember that diskstart/diskend are block offsets! */ a_file_write(&cs->aq, cs->fd, t->diskstart, &t->buffer, t->diskend - t->diskstart, storeCossWriteMemBufDone, t, NULL); } @@ -492,11 +544,17 @@ storeCossWriteMemBufDone(int fd, int err CossInfo *cs = (CossInfo *) t->SD->fsdata; debug(79, 3) ("storeCossWriteMemBufDone: buf %p, len %ld\n", t, (long int) len); - if (errflag) - debug(79, 0) ("storeCossMemBufWriteDone: got failure (%d)\n", errflag); + if (errflag) { + coss_stats.stripe_write.fail++; + debug(79, 1) ("storeCossWriteMemBufDone: got failure (%d)\n", errflag); + debug(79, 1) ("FD %d, size=%x\n", fd, t->diskend - t->diskstart); + } else { + coss_stats.stripe_write.success++; + } dlinkDelete(&t->node, &cs->membufs); cbdataFree(t); + coss_stats.stripes--; } static CossMemBuf * @@ -509,12 +567,11 @@ storeCossCreateMemBuf(SwapDir * SD, size int numreleased = 0; CossInfo *cs = (CossInfo *) SD->fsdata; - CBDATA_INIT_TYPE_FREECB(CossMemBuf, NULL); newmb = cbdataAlloc(CossMemBuf); newmb->diskstart = start; debug(79, 3) ("storeCossCreateMemBuf: creating new membuf at %ld\n", (long int) newmb->diskstart); debug(79, 3) ("storeCossCreateMemBuf: at %p\n", newmb); - newmb->diskend = newmb->diskstart + COSS_MEMBUF_SZ - 1; + newmb->diskend = newmb->diskstart + COSS_MEMBUF_SZ; newmb->flags.full = 0; newmb->flags.writing = 0; newmb->lockcount = 0; @@ -523,21 +580,23 @@ storeCossCreateMemBuf(SwapDir * SD, size dlinkAdd(newmb, &newmb->node, &cs->membufs); /* Print out the list of membufs */ + debug(79, 3) ("storeCossCreateMemBuf: membuflist:\n"); for (m = cs->membufs.head; m; m = m->next) { t = m->data; - debug(79, 3) ("storeCossCreateMemBuf: membuflist %ld lockcount %d\n", (long int) t->diskstart, t->lockcount); + membuf_describe(t, 3, __LINE__); } /* * Kill objects from the tail to make space for a new chunk */ for (m = cs->index.tail; m; m = prev) { + off_t o; prev = m->prev; e = m->data; + o = storeCossFilenoToDiskOffset(e->swap_filen, cs); if (curfn == e->swap_filen) *collision = 1; /* Mark an object alloc collision */ - if ((e->swap_filen >= newmb->diskstart) && - (e->swap_filen <= newmb->diskend)) { + if ((o >= newmb->diskstart) && (o < newmb->diskend)) { storeRelease(e); numreleased++; } else @@ -545,6 +604,7 @@ storeCossCreateMemBuf(SwapDir * SD, size } if (numreleased > 0) debug(79, 3) ("storeCossCreateMemBuf: this allocation released %d storeEntries\n", numreleased); + coss_stats.stripes++; return newmb; } @@ -555,7 +615,11 @@ void storeCossStartMembuf(SwapDir * sd) { CossInfo *cs = (CossInfo *) sd->fsdata; - CossMemBuf *newmb = storeCossCreateMemBuf(sd, cs->current_offset, -1, NULL); + CossMemBuf *newmb; + CBDATA_INIT_TYPE_FREECB(storeIOState, storeCossIOFreeEntry); + CBDATA_INIT_TYPE_FREECB(CossMemBuf, NULL); + CBDATA_INIT_TYPE_FREECB(storeIOState, storeCossIOFreeEntry); + newmb = storeCossCreateMemBuf(sd, cs->current_offset, -1, NULL); assert(!cs->current_membuf); cs->current_membuf = newmb; } @@ -567,4 +631,28 @@ static void storeCossIOFreeEntry(void *sio) { memPoolFree(coss_state_pool, ((storeIOState *) sio)->fsstate); +} + +static off_t +storeCossFilenoToDiskOffset(sfileno f, CossInfo * cs) +{ + return (off_t) f << cs->blksz_bits; +} + +static sfileno +storeCossDiskOffsetToFileno(off_t o, CossInfo * cs) +{ + assert(0 == (o & cs->blksz_mask)); + return o >> cs->blksz_bits; +} + +static void +membuf_describe(CossMemBuf * t, int level, int line) +{ + debug(79, level) ("membuf %p, LC:%02d, ST:%010lu, FL:%c%c\n", + t, + t->lockcount, + (unsigned long) t->diskstart, + t->flags.full ? 'F' : '.', + t->flags.writing ? 'W' : '.'); } diff -rupN squid-2.5.STABLE3/src/fs/diskd/store_dir_diskd.c squid-2.5.STABLE4/src/fs/diskd/store_dir_diskd.c --- squid-2.5.STABLE3/src/fs/diskd/store_dir_diskd.c Wed Jan 8 20:38:44 2003 +++ squid-2.5.STABLE4/src/fs/diskd/store_dir_diskd.c Wed Jul 23 15:00:34 2003 @@ -1,6 +1,6 @@ /* - * $Id: store_dir_diskd.c,v 1.58.2.7 2003/01/09 03:38:44 hno Exp $ + * $Id: store_dir_diskd.c,v 1.58.2.8 2003/07/23 21:00:34 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -1751,7 +1751,7 @@ storeDiskdDirDumpQ2(StoreEntry * e, cons storeAppendPrintf(e, " Q2=%d", diskdinfo->magic2); } -struct cache_dir_option options[] = +static struct cache_dir_option options[] = { #if NOT_YET {"L1", storeDiskdDirParseL1, storeDiskdDirDumpL1}, diff -rupN squid-2.5.STABLE3/src/ftp.c squid-2.5.STABLE4/src/ftp.c --- squid-2.5.STABLE3/src/ftp.c Sun May 11 11:30:13 2003 +++ squid-2.5.STABLE4/src/ftp.c Wed Jul 16 07:42:51 2003 @@ -1,6 +1,6 @@ /* - * $Id: ftp.c,v 1.316.2.9 2003/05/11 17:30:13 hno Exp $ + * $Id: ftp.c,v 1.316.2.10 2003/07/16 13:42:51 hno Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -266,6 +266,12 @@ static void ftpStateFree(int fdnotused, void *data) { FtpStateData *ftpState = data; + ftpState->ctrl.fd = -1; + if (ftpState->data.fd > -1) { + int fd = ftpState->data.fd; + ftpState->data.fd = -1; + comm_close(fd); + } cbdataFree(ftpState); } @@ -312,10 +318,6 @@ ftpStateFreed(void *data) stringClean(&ftpState->base_href); safe_free(ftpState->filepath); safe_free(ftpState->data.host); - if (ftpState->data.fd > -1) { - comm_close(ftpState->data.fd); - ftpState->data.fd = -1; - } } static void @@ -1734,7 +1736,7 @@ ftpSendPasv(FtpStateData * ftpState) ftpState->state = SENT_PASV; /* * ugly hack for ftp servers like ftp.netscape.com that sometimes - * dont acknowledge PORT commands. + * dont acknowledge PASV commands. */ commSetTimeout(ftpState->data.fd, 15, ftpTimeout, ftpState); } diff -rupN squid-2.5.STABLE3/src/helper.c squid-2.5.STABLE4/src/helper.c --- squid-2.5.STABLE3/src/helper.c Wed Jan 8 13:58:54 2003 +++ squid-2.5.STABLE4/src/helper.c Fri Sep 12 14:30:16 2003 @@ -1,6 +1,6 @@ /* - * $Id: helper.c,v 1.34.2.12 2003/01/08 20:58:54 wessels Exp $ + * $Id: helper.c,v 1.34.2.13 2003/09/12 20:30:16 hno Exp $ * * DEBUG: section 84 Helper process maintenance * AUTHOR: Harvest Derived? @@ -129,6 +129,7 @@ helperOpenServers(helper * hlp) commSetNonBlocking(wfd); comm_add_close_handler(rfd, helperServerFree, srv); } + hlp->last_restart = squid_curtime; safe_free(shortname); safe_free(procname); helperKickQueue(hlp); @@ -214,6 +215,7 @@ helperStatefulOpenServers(statefulhelper commSetNonBlocking(wfd); comm_add_close_handler(rfd, helperStatefulServerFree, srv); } + hlp->last_restart = squid_curtime; safe_free(shortname); safe_free(procname); helperStatefulKickQueue(hlp); @@ -659,8 +661,13 @@ helperServerFree(int fd, void *data) if (!srv->flags.shutdown) { debug(84, 0) ("WARNING: %s #%d (FD %d) exited\n", hlp->id_name, srv->index + 1, fd); - if (hlp->n_running < hlp->n_to_start / 2) - fatalf("Too few %s processes are running", hlp->id_name); + if (hlp->n_running <= hlp->n_to_start / 2) { + debug(80, 0) ("Too few %s processes are running", hlp->id_name); + if (hlp->last_restart > squid_curtime - 30) + fatalf("The %s helpers are crashing too rapidly, need help!\n", hlp->id_name); + debug(80, 0) ("Starting new helpers\n"); + helperOpenServers(hlp); + } } cbdataUnlock(srv->parent); cbdataFree(srv); @@ -692,8 +699,13 @@ helperStatefulServerFree(int fd, void *d if (!srv->flags.shutdown) { debug(84, 0) ("WARNING: %s #%d (FD %d) exited\n", hlp->id_name, srv->index + 1, fd); - if (hlp->n_running < hlp->n_to_start / 2) - fatalf("Too few %s processes are running", hlp->id_name); + if (hlp->n_running <= hlp->n_to_start / 2) { + debug(80, 0) ("Too few %s processes are running", hlp->id_name); + if (hlp->last_restart > squid_curtime - 30) + fatalf("The %s helpers are crashing too rapidly, need help!\n", hlp->id_name); + debug(80, 0) ("Starting new helpers\n"); + helperStatefulOpenServers(hlp); + } } if (srv->data != NULL) memPoolFree(hlp->datapool, srv->data); diff -rupN squid-2.5.STABLE3/src/htcp.c squid-2.5.STABLE4/src/htcp.c --- squid-2.5.STABLE3/src/htcp.c Sun May 11 11:30:13 2003 +++ squid-2.5.STABLE4/src/htcp.c Wed Aug 6 07:49:01 2003 @@ -1,6 +1,6 @@ /* - * $Id: htcp.c,v 1.38.2.3 2003/05/11 17:30:13 hno Exp $ + * $Id: htcp.c,v 1.38.2.4 2003/08/06 13:49:01 hno Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -919,7 +919,7 @@ htcpQuery(StoreEntry * e, request_t * re stuff.S.method = (char *) RequestMethodStr[req->method]; stuff.S.uri = (char *) storeUrl(e); stuff.S.version = vbuf; - httpBuildRequestHeader(req, req, e, &hdr, -1, flags); + httpBuildRequestHeader(req, req, e, &hdr, flags); memBufDefInit(&mb); packerToMemInit(&pa, &mb); httpHeaderPackInto(&hdr, &pa); diff -rupN squid-2.5.STABLE3/src/http.c squid-2.5.STABLE4/src/http.c --- squid-2.5.STABLE3/src/http.c Sun May 11 11:30:13 2003 +++ squid-2.5.STABLE4/src/http.c Mon Aug 18 11:24:25 2003 @@ -1,6 +1,6 @@ /* - * $Id: http.c,v 1.384.2.4 2003/05/11 17:30:13 hno Exp $ + * $Id: http.c,v 1.384.2.9 2003/08/18 17:24:25 hno Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -721,7 +721,6 @@ httpBuildRequestHeader(request_t * reque request_t * orig_request, StoreEntry * entry, HttpHeader * hdr_out, - int cfd, http_state_flags flags) { /* building buffer for complex strings */ @@ -795,15 +794,22 @@ httpBuildRequestHeader(request_t * reque break; case HDR_HOST: /* - * Normally Squid does not copy the Host: header from - * a client request into the forwarded request headers. - * However, there is one case when we do: If the URL + * Normally Squid rewrites the Host: header. + * However, there is one case when we don't: If the URL * went through our redirector and the admin configured * 'redir_rewrites_host' to be off. */ - if (request->flags.redirected) - if (!Config.onoff.redir_rewrites_host) - httpHeaderAddEntry(hdr_out, httpHeaderEntryClone(e)); + if (request->flags.redirected && !Config.onoff.redir_rewrites_host) + httpHeaderAddEntry(hdr_out, httpHeaderEntryClone(e)); + else { + /* use port# only if not default */ + if (orig_request->port == urlDefaultPort(orig_request->protocol)) { + httpHeaderPutStr(hdr_out, HDR_HOST, orig_request->host); + } else { + httpHeaderPutStrf(hdr_out, HDR_HOST, "%s:%d", + orig_request->host, (int) orig_request->port); + } + } break; case HDR_IF_MODIFIED_SINCE: /* append unless we added our own; @@ -849,7 +855,9 @@ httpBuildRequestHeader(request_t * reque /* append X-Forwarded-For */ strFwd = httpHeaderGetList(hdr_in, HDR_X_FORWARDED_FOR); - strListAdd(&strFwd, (cfd < 0 ? "unknown" : fd_table[cfd].ipaddr), ','); + strListAdd(&strFwd, + (((orig_request->client_addr.s_addr != no_addr.s_addr) && opt_forwarded_for) ? + inet_ntoa(orig_request->client_addr) : "unknown"), ','); httpHeaderPutStr(hdr_out, HDR_X_FORWARDED_FOR, strBuf(strFwd)); stringClean(&strFwd); @@ -899,6 +907,10 @@ httpBuildRequestHeader(request_t * reque if (strLen(request->urlpath)) assert(strstr(url, strBuf(request->urlpath))); } + /* Set no-cache if determined needed but not found */ + if (orig_request->flags.nocache && !httpHeaderHas(hdr_in, HDR_PRAGMA)) + EBIT_SET(cc->mask, CC_NO_CACHE); + /* Enforce sibling relations */ if (flags.only_if_cached) EBIT_SET(cc->mask, CC_ONLY_IF_CACHED); httpHeaderPutCc(hdr_out, cc); @@ -913,7 +925,7 @@ httpBuildRequestHeader(request_t * reque } } /* Now mangle the headers. */ - httpHdrMangleList(hdr_out, request); + httpHdrMangleList(hdr_out, orig_request); stringClean(&strConnection); } @@ -924,7 +936,6 @@ httpBuildRequestPrefix(request_t * reque request_t * orig_request, StoreEntry * entry, MemBuf * mb, - int cfd, http_state_flags flags) { const int offset = mb->size; @@ -935,7 +946,7 @@ httpBuildRequestPrefix(request_t * reque { HttpHeader hdr; Packer p; - httpBuildRequestHeader(request, orig_request, entry, &hdr, cfd, flags); + httpBuildRequestHeader(request, orig_request, entry, &hdr, flags); packerToMemInit(&p, mb); httpHeaderPackInto(&hdr, &p); httpHeaderClean(&hdr); @@ -952,7 +963,6 @@ httpSendRequest(HttpStateData * httpStat MemBuf mb; request_t *req = httpState->request; StoreEntry *entry = httpState->entry; - int cfd; peer *p = httpState->peer; CWCB *sendHeaderDone; @@ -963,13 +973,6 @@ httpSendRequest(HttpStateData * httpStat else sendHeaderDone = httpSendComplete; - if (!opt_forwarded_for) - cfd = -1; - else if (entry->mem_obj == NULL) - cfd = -1; - else - cfd = entry->mem_obj->fd; - assert(-1 == cfd || FD_SOCKET == fd_table[cfd].type); if (p != NULL) httpState->flags.proxying = 1; else @@ -994,7 +997,6 @@ httpSendRequest(HttpStateData * httpStat httpState->orig_request, entry, &mb, - cfd, httpState->flags); debug(11, 6) ("httpSendRequest: FD %d:\n%s\n", httpState->fd, mb.buf); comm_write_mbuf(httpState->fd, mb, sendHeaderDone, httpState); diff -rupN squid-2.5.STABLE3/src/icmp.c squid-2.5.STABLE4/src/icmp.c --- squid-2.5.STABLE3/src/icmp.c Thu Jan 2 16:10:46 2003 +++ squid-2.5.STABLE4/src/icmp.c Thu Jun 12 17:55:05 2003 @@ -1,6 +1,6 @@ /* - * $Id: icmp.c,v 1.73.2.3 2003/01/02 23:10:46 wessels Exp $ + * $Id: icmp.c,v 1.73.2.4 2003/06/12 23:55:05 wessels Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels @@ -78,7 +78,7 @@ icmpRecv(int unused1, void *unused2) (char *) &preply, sizeof(pingerReplyData), 0); - if (n < 0) { + if (n < 0 && EAGAIN != errno) { debug(50, 1) ("icmpRecv: recv: %s\n", xstrerror()); if (++fail_count == 10 || errno == ECONNREFUSED) icmpClose(); diff -rupN squid-2.5.STABLE3/src/main.c squid-2.5.STABLE4/src/main.c --- squid-2.5.STABLE3/src/main.c Mon May 5 18:24:14 2003 +++ squid-2.5.STABLE4/src/main.c Sun Jun 8 17:28:46 2003 @@ -1,6 +1,6 @@ /* - * $Id: main.c,v 1.345.2.10 2003/05/06 00:24:14 hno Exp $ + * $Id: main.c,v 1.345.2.11 2003/06/08 23:28:46 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -881,6 +881,8 @@ watch_child(char *argv[]) */ /* Connect stdio to /dev/null in daemon mode */ nullfd = open("/dev/null", O_RDWR | O_TEXT); + if (nullfd < 0) + fatalf("/dev/null: %s\n", xstrerror()); dup2(nullfd, 0); if (opt_debug_stderr < 0) { dup2(nullfd, 1); diff -rupN squid-2.5.STABLE3/src/neighbors.c squid-2.5.STABLE4/src/neighbors.c --- squid-2.5.STABLE3/src/neighbors.c Tue Aug 27 22:41:16 2002 +++ squid-2.5.STABLE4/src/neighbors.c Tue Aug 12 18:28:19 2003 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.299.2.2 2002/08/28 04:41:16 wessels Exp $ + * $Id: neighbors.c,v 1.299.2.3 2003/08/13 00:28:19 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -430,6 +430,7 @@ neighborsUdpPing(request_t * request, int peers_pinged = 0; int parent_timeout = 0, parent_exprep = 0; int sibling_timeout = 0, sibling_exprep = 0; + int mcast_timeout = 0, mcast_exprep = 0; if (Config.peers == NULL) return 0; @@ -490,7 +491,8 @@ neighborsUdpPing(request_t * request, * says a multicast peer is dead. */ p->stats.last_reply = squid_curtime; - (*exprep) += p->mcast.n_replies_expected; + mcast_exprep += p->mcast.n_replies_expected; + mcast_timeout += (p->stats.rtt * p->mcast.n_replies_expected); } else if (neighborUp(p)) { /* its alive, expect a reply from it */ if (neighborType(p, request) == PEER_PARENT) { @@ -551,7 +553,7 @@ neighborsUdpPing(request_t * request, /* * How many replies to expect? */ - *exprep = parent_exprep + sibling_exprep; + *exprep = parent_exprep + sibling_exprep + mcast_exprep; /* * If there is a configured timeout, use it @@ -562,6 +564,8 @@ neighborsUdpPing(request_t * request, if (*exprep > 0) { if (parent_exprep) *timeout = 2 * parent_timeout / parent_exprep; + else if (mcast_exprep) + *timeout = 2 * mcast_timeout / mcast_exprep; else *timeout = 2 * sibling_timeout / sibling_exprep; } else diff -rupN squid-2.5.STABLE3/src/peer_digest.c squid-2.5.STABLE4/src/peer_digest.c --- squid-2.5.STABLE3/src/peer_digest.c Wed Oct 24 00:55:44 2001 +++ squid-2.5.STABLE4/src/peer_digest.c Wed Jul 16 14:22:39 2003 @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.c,v 1.83 2001/10/24 06:55:44 hno Exp $ + * $Id: peer_digest.c,v 1.83.2.1 2003/07/16 20:22:39 wessels Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -688,7 +688,7 @@ peerDigestFetchFinish(DigestFetchState * if (fetch->old_entry) { debug(72, 2) ("peerDigestFetchFinish: deleting old entry\n"); - storeUnregister(fetch->sc, fetch->old_entry, fetch); + storeUnregister(fetch->old_sc, fetch->old_entry, fetch); storeReleaseRequest(fetch->old_entry); storeUnlockObject(fetch->old_entry); fetch->old_entry = NULL; diff -rupN squid-2.5.STABLE3/src/protos.h squid-2.5.STABLE4/src/protos.h --- squid-2.5.STABLE3/src/protos.h Tue May 6 14:13:02 2003 +++ squid-2.5.STABLE4/src/protos.h Sun Aug 10 15:04:47 2003 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.420.2.18 2003/05/06 20:13:02 hno Exp $ + * $Id: protos.h,v 1.420.2.20 2003/08/10 21:04:47 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -142,7 +142,7 @@ extern void clientHttpConnectionsClose(v extern StoreEntry *clientCreateStoreEntry(clientHttpRequest *, method_t, request_flags); extern int isTcpHit(log_type); extern void clientReadBody(request_t * req, char *buf, size_t size, CBCB * callback, void *data); -extern int clientAbortBody(request_t * req); +extern void clientAbortBody(request_t * req); extern int commSetNonBlocking(int fd); extern int commUnsetNonBlocking(int fd); @@ -309,12 +309,11 @@ extern mb_size_t httpBuildRequestPrefix( request_t * orig_request, StoreEntry * entry, MemBuf * mb, - int cfd, http_state_flags); extern void httpAnonInitModule(void); extern int httpAnonHdrAllowed(http_hdr_type hdr_id); extern int httpAnonHdrDenied(http_hdr_type hdr_id); -extern void httpBuildRequestHeader(request_t *, request_t *, StoreEntry *, HttpHeader *, int, http_state_flags); +extern void httpBuildRequestHeader(request_t *, request_t *, StoreEntry *, HttpHeader *, http_state_flags); extern void httpBuildVersion(http_version_t * version, unsigned int major, unsigned int minor); extern const char *httpMakeVaryMark(request_t * request, HttpReply * reply); diff -rupN squid-2.5.STABLE3/src/snmp_agent.c squid-2.5.STABLE4/src/snmp_agent.c --- squid-2.5.STABLE3/src/snmp_agent.c Fri May 2 03:48:43 2003 +++ squid-2.5.STABLE4/src/snmp_agent.c Tue Jun 24 15:08:42 2003 @@ -1,6 +1,6 @@ /* - * $Id: snmp_agent.c,v 1.83.2.1 2003/05/02 09:48:43 hno Exp $ + * $Id: snmp_agent.c,v 1.83.2.2 2003/06/24 21:08:42 wessels Exp $ * * DEBUG: section 49 SNMP Interface * AUTHOR: Kostas Anagnostakis @@ -195,12 +195,12 @@ snmp_meshPtblFn(variable_list * Var, sni case MESH_PTBL_SENT: Answer = snmp_var_new_integer(Var->name, Var->name_length, p->stats.pings_sent, - ASN_INTEGER); + SMI_COUNTER32); break; case MESH_PTBL_PACKED: Answer = snmp_var_new_integer(Var->name, Var->name_length, p->stats.pings_acked, - ASN_INTEGER); + SMI_COUNTER32); break; case MESH_PTBL_FETCHES: Answer = snmp_var_new_integer(Var->name, Var->name_length, diff -rupN squid-2.5.STABLE3/src/snmp_core.c squid-2.5.STABLE4/src/snmp_core.c --- squid-2.5.STABLE3/src/snmp_core.c Thu Feb 14 12:02:17 2002 +++ squid-2.5.STABLE4/src/snmp_core.c Wed Jun 18 17:53:35 2003 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.c,v 1.51.2.2 2002/02/14 19:02:17 hno Exp $ + * $Id: snmp_core.c,v 1.51.2.3 2003/06/18 23:53:35 hno Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -607,10 +607,10 @@ snmpAgentResponse(struct snmp_pdu *PDU) return (Answer); } else if (PDU->command == SNMP_PDU_GETNEXT) { oid *NextOidName = NULL; - int NextOidNameLen = 0; + snint NextOidNameLen = 0; ParseFn = snmpTreeNext(PDU->variables->name, PDU->variables->name_length, - &(NextOidName), (snint *) & NextOidNameLen); + &NextOidName, &NextOidNameLen); if (ParseFn == NULL) { Answer->errstat = SNMP_ERR_NOSUCHNAME; diff -rupN squid-2.5.STABLE3/src/ssl.c squid-2.5.STABLE4/src/ssl.c --- squid-2.5.STABLE3/src/ssl.c Sun Feb 9 14:42:03 2003 +++ squid-2.5.STABLE4/src/ssl.c Wed Aug 6 07:49:02 2003 @@ -1,6 +1,6 @@ /* - * $Id: ssl.c,v 1.118.2.3 2003/02/09 21:42:03 hno Exp $ + * $Id: ssl.c,v 1.118.2.4 2003/08/06 13:49:02 hno Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -556,7 +556,6 @@ sslProxyConnected(int fd, void *data) sslState->request, NULL, /* StoreEntry */ &hdr_out, - sslState->client.fd, flags); /* flags */ packerToMemInit(&p, &mb); httpHeaderPackInto(&hdr_out, &p); diff -rupN squid-2.5.STABLE3/src/stat.c squid-2.5.STABLE4/src/stat.c --- squid-2.5.STABLE3/src/stat.c Sun Jan 26 22:00:46 2003 +++ squid-2.5.STABLE4/src/stat.c Sun Jun 22 15:32:10 2003 @@ -1,6 +1,6 @@ /* - * $Id: stat.c,v 1.351.2.8 2003/01/27 05:00:46 wessels Exp $ + * $Id: stat.c,v 1.351.2.9 2003/06/22 21:32:10 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -950,6 +950,8 @@ statAvgTick(void *notused) #elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO struct mallinfo mp = mallinfo(); i = mp.arena; +#elif HAVE_SBRK + i = (size_t) ((char *) sbrk(0) - (char *) sbrk_start); #endif if (Config.warnings.high_memory < i) debug(18, 0) ("WARNING: Memory usage at %d MB\n", i >> 20); diff -rupN squid-2.5.STABLE3/src/store.c squid-2.5.STABLE4/src/store.c --- squid-2.5.STABLE3/src/store.c Thu Jan 30 22:13:52 2003 +++ squid-2.5.STABLE4/src/store.c Wed Aug 6 07:49:02 2003 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.544.2.2 2003/01/31 05:13:52 wessels Exp $ + * $Id: store.c,v 1.544.2.4 2003/08/06 13:49:02 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -121,7 +121,6 @@ new_MemObject(const char *url, const cha #endif mem->log_url = xstrdup(log_url); mem->object_sz = -1; - mem->fd = -1; /* XXX account log_url */ debug(20, 3) ("new_MemObject: returning %p\n", mem); return mem; @@ -155,11 +154,13 @@ destroy_MemObject(StoreEntry * e) assert(mem->swapout.sio == NULL); stmemFree(&mem->data_hdr); mem->inmem_hi = 0; +#if 0 /* * There is no way to abort FD-less clients, so they might - * still have mem->clients set if mem->fd == -1 + * still have mem->clients set. */ - assert(mem->fd == -1 || mem->clients.head == NULL); + assert(mem->clients.head == NULL); +#endif httpReplyDestroy(mem->reply); requestUnlink(mem->request); mem->request = NULL; @@ -618,15 +619,15 @@ storeCheckCachable(StoreEntry * e) store_check_cachable_hist.no.non_get++; } else #endif - if (!EBIT_TEST(e->flags, ENTRY_CACHABLE)) { - debug(20, 2) ("storeCheckCachable: NO: not cachable\n"); - store_check_cachable_hist.no.not_entry_cachable++; + if (e->store_status == STORE_OK && EBIT_TEST(e->flags, ENTRY_BAD_LENGTH)) { + debug(20, 2) ("storeCheckCachable: NO: wrong content-length\n"); + store_check_cachable_hist.no.wrong_content_length++; } else if (EBIT_TEST(e->flags, RELEASE_REQUEST)) { debug(20, 2) ("storeCheckCachable: NO: release requested\n"); store_check_cachable_hist.no.release_request++; - } else if (e->store_status == STORE_OK && EBIT_TEST(e->flags, ENTRY_BAD_LENGTH)) { - debug(20, 2) ("storeCheckCachable: NO: wrong content-length\n"); - store_check_cachable_hist.no.wrong_content_length++; + } else if (!EBIT_TEST(e->flags, ENTRY_CACHABLE)) { + debug(20, 2) ("storeCheckCachable: NO: not cachable\n"); + store_check_cachable_hist.no.not_entry_cachable++; } else if (EBIT_TEST(e->flags, ENTRY_NEGCACHED)) { debug(20, 3) ("storeCheckCachable: NO: negative cached\n"); store_check_cachable_hist.no.negative_cached++; diff -rupN squid-2.5.STABLE3/src/store_client.c squid-2.5.STABLE4/src/store_client.c --- squid-2.5.STABLE3/src/store_client.c Wed Jan 22 18:57:02 2003 +++ squid-2.5.STABLE4/src/store_client.c Wed Aug 6 07:49:03 2003 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.105.2.1 2003/01/23 01:57:02 wessels Exp $ + * $Id: store_client.c,v 1.105.2.2 2003/08/06 13:49:03 hno Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -511,13 +511,6 @@ storeUnregister(store_client * sc, Store return 0; if (mem->clients.head == NULL) return 0; - if (sc == mem->clients.head->data) { - /* - * If we are unregistering the _first_ client for this - * entry, then we have to reset the client FD to -1. - */ - mem->fd = -1; - } dlinkDelete(&sc->node, &mem->clients); mem->nclients--; if (e->store_status == STORE_OK && e->swap_status != SWAPOUT_DONE) diff -rupN squid-2.5.STABLE3/src/store_dir.c squid-2.5.STABLE4/src/store_dir.c --- squid-2.5.STABLE3/src/store_dir.c Mon Apr 1 05:33:47 2002 +++ squid-2.5.STABLE4/src/store_dir.c Thu Jul 17 09:39:49 2003 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.c,v 1.135.2.1 2002/04/01 12:33:47 hno Exp $ + * $Id: store_dir.c,v 1.135.2.2 2003/07/17 15:39:49 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -153,7 +153,7 @@ storeDirSelectSwapDirRoundRobin(const St continue; if (sd->cur_size > sd->max_size) continue; - if (!storeDirValidSwapDirSize(i, objsize)) + if (!storeDirValidSwapDirSize(dirn, objsize)) continue; /* check for error or overload condition */ load = sd->checkobj(sd, e); diff -rupN squid-2.5.STABLE3/src/structs.h squid-2.5.STABLE4/src/structs.h --- squid-2.5.STABLE3/src/structs.h Sat May 10 16:17:44 2003 +++ squid-2.5.STABLE4/src/structs.h Fri Sep 12 14:30:16 2003 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.408.2.11 2003/05/10 22:17:44 hno Exp $ + * $Id: structs.h,v 1.408.2.14 2003/09/12 20:30:16 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -638,7 +638,6 @@ struct _SquidConfig { } icons; char *errorDirectory; struct { - time_t timeout; int maxtries; } retry; struct { @@ -1493,7 +1492,6 @@ struct _MemObject { struct timeval start_ping; IRCB *ping_reply_callback; void *ircb_data; - int fd; /* FD of client creating this entry */ struct { STABH *callback; void *data; @@ -2017,6 +2015,7 @@ struct _helper { int queue_size; int avg_svc_time; } stats; + time_t last_restart; }; struct _helper_stateful { @@ -2037,6 +2036,7 @@ struct _helper_stateful { int queue_size; int avg_svc_time; } stats; + time_t last_restart; }; struct _helper_server { diff -rupN squid-2.5.STABLE3/src/tools.c squid-2.5.STABLE4/src/tools.c --- squid-2.5.STABLE3/src/tools.c Tue Apr 29 10:09:40 2003 +++ squid-2.5.STABLE4/src/tools.c Tue Jun 24 14:52:26 2003 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.213.2.6 2003/04/29 16:09:40 hno Exp $ + * $Id: tools.c,v 1.213.2.8 2003/06/24 20:52:26 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -987,6 +987,7 @@ parseEtcHosts(void) char *addr; if (buf[0] == '#') /* MS-windows likes to add comments */ continue; + strtok(buf, "#"); /* chop everything following a comment marker */ lt = buf; addr = buf; debug(1, 5) ("etc_hosts: line is '%s'\n", buf); diff -rupN squid-2.5.STABLE3/src/unlinkd.c squid-2.5.STABLE4/src/unlinkd.c --- squid-2.5.STABLE3/src/unlinkd.c Sat Jul 20 18:30:03 2002 +++ squid-2.5.STABLE4/src/unlinkd.c Mon Jul 21 16:34:50 2003 @@ -1,6 +1,6 @@ /* - * $Id: unlinkd.c,v 1.44.2.1 2002/07/21 00:30:03 hno Exp $ + * $Id: unlinkd.c,v 1.44.2.2 2003/07/21 22:34:50 wessels Exp $ * * DEBUG: section 2 Unlink Daemon * AUTHOR: Duane Wessels @@ -139,6 +139,7 @@ unlinkdUnlink(const char *path) return; } statCounter.unlink.requests++; + statCounter.syscalls.disk.unlinks++; queuelen++; }