From: serassio <> Date: Sun, 6 Mar 2005 21:46:24 +0000 (+0000) Subject: Forward port of all the header parsing cleanup of 2.5.STABLE8: X-Git-Tag: SQUID_3_0_PRE4~863 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52d3f1986d5dd7a7a89d039f20c359f593d24658;p=thirdparty%2Fsquid.git Forward port of all the header parsing cleanup of 2.5.STABLE8: - squid-2.5.STABLE7-header_parsing.patch - Bug #1228 - Bug #1242 - Relaxed_header_parser squid.conf option. - New ERR_INVALID_RESP error message. --- diff --git a/errors/Bulgarian/ERR_INVALID_RESP b/errors/Bulgarian/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Bulgarian/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Catalan/ERR_INVALID_RESP b/errors/Catalan/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Catalan/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Czech/ERR_INVALID_RESP b/errors/Czech/ERR_INVALID_RESP new file mode 100755 index 0000000000..d3a130711b --- /dev/null +++ b/errors/Czech/ERR_INVALID_RESP @@ -0,0 +1,27 @@ + +
+ ++Pøi provádìní po¾adavku: +
+%R ++
+se objevila následující chyba: +
+HTTP odpovìï obdr¾ená od vzdáleného serveru je nesrozumitelná èi po¹kozená. +Kontaktujte prosím správce vzdáleného serveru. Dal¹í informace Vám poskytne +správce tohoto proxy serveru %w diff --git a/errors/Danish/ERR_INVALID_RESP b/errors/Danish/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Danish/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Dutch/ERR_INVALID_RESP b/errors/Dutch/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Dutch/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/English/ERR_INVALID_RESP b/errors/English/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/English/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Estonian/ERR_INVALID_RESP b/errors/Estonian/ERR_INVALID_RESP new file mode 100755 index 0000000000..6c746c396e --- /dev/null +++ b/errors/Estonian/ERR_INVALID_RESP @@ -0,0 +1,28 @@ + +
++Üritades käsitleda järgnevat päringut: +
+%R ++
+Tekkis viga: +
+Vasti võetud HTTP vastus on tundmatu või muidu katki. Palun kontakteeruge +saidi operaatoriga. Teie vehemälu serveri administraator võib saada anda +täiendavat infot selle vea detailide kohta. + +
Teie vehemälu serveri administraator on %w. diff --git a/errors/Finnish/ERR_INVALID_RESP b/errors/Finnish/ERR_INVALID_RESP new file mode 100755 index 0000000000..e3c70d8da6 --- /dev/null +++ b/errors/Finnish/ERR_INVALID_RESP @@ -0,0 +1,28 @@ + +
++Yritettäessä toimittaa pyyntöä: +
+%R ++
+Tapahtui seuraava virhe: +
+Palvelimen lähettämää HTTP-vastausta ei ymmärretty tai se oli +väärän muotoinen. Ota yhteyttä palvelimen ylläpitäjään. +Välipalvelimesi ylläpitäjältä voit saada lisätietoja +ongelman luonteesta. +
Välityspalvelintasi ylläpitää %w. diff --git a/errors/French/ERR_INVALID_RESP b/errors/French/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/French/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/German/ERR_INVALID_RESP b/errors/German/ERR_INVALID_RESP new file mode 100755 index 0000000000..74bd383710 --- /dev/null +++ b/errors/German/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++Während des Versuches, die Anfrage +
+%R ++
+zu verarbeiten, trat der folgende Fehler auf: +
+Die HTTP Antwortmeldung des kontaktierten Servers konnte nicht verstanden werden +oder war auf andere Weise missgebildet. Bitte kontaktieren Sie den Betreiber der +betreffenden Webseite. Wenn nötig kann Ihr Cache Administrator in der Lage sein, +Sie mit mehr Details über die genaue Ursache des Problems zu versorgen. + +
Ihr Cache Administrator ist %w. diff --git a/errors/Hebrew/ERR_INVALID_RESP b/errors/Hebrew/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Hebrew/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Hungarian/ERR_INVALID_RESP b/errors/Hungarian/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Hungarian/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Italian/ERR_INVALID_RESP b/errors/Italian/ERR_INVALID_RESP new file mode 100755 index 0000000000..fd50ad1224 --- /dev/null +++ b/errors/Italian/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++Mentre si elaborava la richiesta: +
+%R ++
+È avvenuto il seguente errore: +
+Il messaggio contenente la risposta HTTP ricevuto dal server che si sta +contattando non può essere interpretato od è stato in qualche modo alterato. +Si prega di contattare un operatore del sito. Se necessario, l'amministratore della vostra +cache potrà fornirvi maggiori dettagli sull'esatta natura del problema. + +
L'amministratore della vostra cache è %w. diff --git a/errors/Japanese/ERR_INVALID_RESP b/errors/Japanese/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Japanese/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Korean/ERR_INVALID_RESP b/errors/Korean/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Korean/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Lithuanian/ERR_INVALID_RESP b/errors/Lithuanian/ERR_INVALID_RESP new file mode 100755 index 0000000000..053154f244 --- /dev/null +++ b/errors/Lithuanian/ERR_INVALID_RESP @@ -0,0 +1,27 @@ + +
++Bandant ávykdyti uþklausà: +
+%R ++
+Gautas klaidos praneðimas: +
+Ið serverio gautas nesuprantamas HTTP atsakymas arba jis buvo klaidingai +suformuotas. Susisiekite su serverio operatoriumi. Jûsø proxy serverio +administratorius gali suteikti jums daugiau informacijos apie ðià problemà. +
diff --git a/errors/Polish/ERR_INVALID_RESP b/errors/Polish/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Polish/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + + ++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Portuguese/ERR_INVALID_RESP b/errors/Portuguese/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Portuguese/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Romanian/ERR_INVALID_RESP b/errors/Romanian/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Romanian/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Russian-1251/ERR_INVALID_RESP b/errors/Russian-1251/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Russian-1251/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Russian-koi8-r/ERR_INVALID_RESP b/errors/Russian-koi8-r/ERR_INVALID_RESP new file mode 100755 index 0000000000..080b7184ac --- /dev/null +++ b/errors/Russian-koi8-r/ERR_INVALID_RESP @@ -0,0 +1,31 @@ + +
+ ++÷Ï ×ÒÅÍÑ ÏÂÒÁÂÏÔËÉ ÚÁÐÒÏÓÁ: +
+%R ++
+ðÒÏÉÚÏÛÌÁ ÓÌÅÄÕÀÝÁÑ ÏÛÉÂËÁ: +
+HTTP ÏÔ×ÅÔ, ÐÏÌÕÞÅÎÎÙÊ ÏÔ ÚÁÐÒÁÛÉ×ÁÅÍÏÇÏ ÓÅÒ×ÅÒÁ ÎÅÐÏÎÑÔÅÎ ÉÌÉ +ÉÚÕÒÏÄÏ×ÁÎ. ïÂÒÁÝÁÊÔÅÓØ Ë ÁÄÍÉÎÉÓÔÒÁÔÏÒÁÍ ÚÁÐÒÁÛÉ×ÁÅÍÏÇÏ ÓÁÊÔÁ. +áÄÍÉÎÉÓÔÒÁÔÏÒ ×ÁÛÅÇÏ ÐÒÏËÓÉ-ÓÅÒ×ÅÒÁ ÍÏÖÅÔ ÐÒÉ ÎÅÏÂÈÏÄÉÍÏÓÔÉ +ÂÏÌÅÅ ÄÅÔÁÌØÎÏ ÏÐÉÓÁÔØ ÓÕÝÅÓÔ×Ï ÐÒÏÂÌÅÍÙ. + +
+áÄÒÅÓ áÄÍÉÎÉÓÔÒÁÔÏÒÁ ×ÁÛÅÇÏ ÐÒÏËÓÉ-ÓÅÒ×ÅÒÁ: %w. diff --git a/errors/Serbian/ERR_INVALID_RESP b/errors/Serbian/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Serbian/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Simplify_Chinese/ERR_INVALID_RESP b/errors/Simplify_Chinese/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Simplify_Chinese/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Slovak/ERR_INVALID_RESP b/errors/Slovak/ERR_INVALID_RESP new file mode 100755 index 0000000000..7dbb2b1dfa --- /dev/null +++ b/errors/Slovak/ERR_INVALID_RESP @@ -0,0 +1,31 @@ + +
+ ++Pri pokuse o prístup k: +
+%R ++
+do¹lo k nasledovnej chybe: +
+HTTP odpovedi obdr¾anej z kontaktovaného servera nebolo mo¾né porozumie» +alebo bola nejako po¹kodená. Kontaktujte prosím správcu servera. V prípade +potreby Vám Vá¹ cache administrátor mô¾e poskytnú» detaily o presnej povahe +problému. +
+ +Va¹ím cache administrátorom je %w.
diff --git a/errors/Spanish/ERR_INVALID_RESP b/errors/Spanish/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Spanish/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + + ++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Swedish/ERR_INVALID_RESP b/errors/Swedish/ERR_INVALID_RESP new file mode 100755 index 0000000000..629e371cd7 --- /dev/null +++ b/errors/Swedish/ERR_INVALID_RESP @@ -0,0 +1,30 @@ + +
++Vid försöket att hämta URL: +%U +
+Mottogs följande fel: +
+HTTP svarsmeddelandet ifrån den kontaktade servern är felaktigt och +kunde inte tolkas. Vänligen kontakta den ansvariga för webbservern ifråga. +Din cacheserver administratör man eventuellt ge dig mera information om +det specifika problemet med denna sida. +
+ +Din cacheserver administratör är %w. +
+ diff --git a/errors/Traditional_Chinese/ERR_INVALID_RESP b/errors/Traditional_Chinese/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Traditional_Chinese/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + + ++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w. diff --git a/errors/Turkish/ERR_INVALID_RESP b/errors/Turkish/ERR_INVALID_RESP new file mode 100755 index 0000000000..960968c405 --- /dev/null +++ b/errors/Turkish/ERR_INVALID_RESP @@ -0,0 +1,29 @@ + +
++While trying to process the request: +
+%R ++
+The following error was encountered: +
+The HTTP Response message received from the contacted server +could not be understood or was otherwise malformed. Please contact +the site operator. Your cache administrator may be able to provide +you with more details about the exact nature of the problem if needed. + +
Your cache administrator is %w.
diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc
index 464d07c55e..718b18de42 100644
--- a/src/HttpHeader.cc
+++ b/src/HttpHeader.cc
@@ -1,6 +1,6 @@
/*
- * $Id: HttpHeader.cc,v 1.101 2004/12/20 16:30:32 robertc Exp $
+ * $Id: HttpHeader.cc,v 1.102 2005/03/06 14:46:29 serassio Exp $
*
* DEBUG: section 55 HTTP Header
* AUTHOR: Alex Rousskov
@@ -467,59 +467,115 @@ httpHeaderReset(HttpHeader * hdr)
int
httpHeaderParse(HttpHeader * hdr, const char *header_start, const char *header_end)
{
- const char *field_start = header_start;
- HttpHeaderEntry *e;
+ const char *field_ptr = header_start;
+ HttpHeaderEntry *e, *e2;
assert(hdr);
assert(header_start && header_end);
debug(55, 7) ("parsing hdr: (%p)\n%s\n", hdr, getStringPrefix(header_start, header_end));
HttpHeaderStats[hdr->owner].parsedCount++;
- /* commonn format headers are "