Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1573895
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: squid

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: squid-2.5.STABLE10-content_length.patch


Index: squid/src/HttpHeader.c
diff -c squid/src/HttpHeader.c:1.74.2.28 squid/src/HttpHeader.c:1.74.2.29
*** squid/src/HttpHeader.c:1.74.2.28	Fri May  6 15:32:09 2005
--- squid/src/HttpHeader.c	Wed May 25 16:57:33 2005
***************
*** 475,483 ****
  	}
  	if (e->id == HDR_CONTENT_LENGTH && (e2 = httpHeaderFindEntry(hdr, e->id)) != NULL) {
  	    if (strCmp(e->value, strBuf(e2->value)) != 0) {
! 		debug(55, 1) ("WARNING: found two conflicting content-length headers in {%s}\n", getStringPrefix(header_start, header_end));
! 		httpHeaderEntryDestroy(e);
! 		return httpHeaderReset(hdr);
  	    } else {
  		debug(55, Config.onoff.relaxed_header_parser <= 0 ? 1 : 2)
  		    ("NOTICE: found double content-length header\n");
--- 475,499 ----
  	}
  	if (e->id == HDR_CONTENT_LENGTH && (e2 = httpHeaderFindEntry(hdr, e->id)) != NULL) {
  	    if (strCmp(e->value, strBuf(e2->value)) != 0) {
! 		squid_off_t l1, l2;
! 		debug(55, Config.onoff.relaxed_header_parser <= 0 ? 1 : 2) ("WARNING: found two conflicting content-length headers in {%s}\n", getStringPrefix(header_start, header_end));
! 		if (!Config.onoff.relaxed_header_parser) {
! 		    httpHeaderEntryDestroy(e);
! 		    return httpHeaderReset(hdr);
! 		}
! 		if (!httpHeaderParseSize(strBuf(e->value), &l1)) {
! 		    debug(55, 1) ("WARNING: Unparseable content-length '%s'\n", strBuf(e->value));
! 		    httpHeaderEntryDestroy(e);
! 		    continue;
! 		} else if (!httpHeaderParseSize(strBuf(e2->value), &l2)) {
! 		    debug(55, 1) ("WARNING: Unparseable content-length '%s'\n", strBuf(e2->value));
! 		    httpHeaderDelById(hdr, e2->id);
! 		} else if (l1 > l2) {
! 		    httpHeaderDelById(hdr, e2->id);
! 		} else {
! 		    httpHeaderEntryDestroy(e);
! 		    continue;
! 		}
  	    } else {
  		debug(55, Config.onoff.relaxed_header_parser <= 0 ? 1 : 2)
  		    ("NOTICE: found double content-length header\n");
 
design & coding: Vladimir Lettiev aka crux © 2004-2005