]> git.pld-linux.org Git - packages/squid.git/blame - squid-2.5.STABLE7-oversize_reply_headers.patch
- updated to 2.5.STABLE13
[packages/squid.git] / squid-2.5.STABLE7-oversize_reply_headers.patch
CommitLineData
657376c6 1Index: squid/src/http.c
2diff -c squid/src/http.c:1.384.2.25 squid/src/http.c:1.384.2.26
3*** squid/src/http.c:1.384.2.25 Fri Jan 21 05:39:37 2005
4--- squid/src/http.c Mon Jan 31 15:44:18 2005
5***************
6*** 401,407 ****
7 size_t hdr_len;
8 size_t hdr_size = headersEnd(buf, size);
9 HttpReply *reply = entry->mem_obj->reply;
10! Ctx ctx;
11 debug(11, 3) ("httpProcessReplyHeader: key '%s'\n",
12 storeKeyText(entry->hash.key));
13 if (memBufIsNull(&httpState->reply_hdr))
14--- 401,407 ----
15 size_t hdr_len;
16 size_t hdr_size = headersEnd(buf, size);
17 HttpReply *reply = entry->mem_obj->reply;
18! Ctx ctx = ctx_enter(entry->mem_obj->url);
19 debug(11, 3) ("httpProcessReplyHeader: key '%s'\n",
20 storeKeyText(entry->hash.key));
21 if (memBufIsNull(&httpState->reply_hdr))
22***************
23*** 418,423 ****
24--- 418,424 ----
25 memBufClean(&httpState->reply_hdr);
26 httpBuildVersion(&reply->sline.version, 0, 9);
27 reply->sline.status = HTTP_INVALID_HEADER;
28+ ctx_exit(ctx);
29 return;
30 }
31 if (hdr_size != hdr_len)
32***************
33*** 429,449 ****
34 if (!memBufIsNull(&httpState->reply_hdr))
35 memBufClean(&httpState->reply_hdr);
36 reply->sline.status = HTTP_HEADER_TOO_LARGE;
37 return;
38 }
39 /* headers can be incomplete only if object still arriving */
40 if (!hdr_size) {
41 if (httpState->eof)
42 hdr_size = hdr_len;
43! else
44 return; /* headers not complete */
45 }
46 /* Cut away any excess body data (only needed for debug?) */
47 memBufAppend(&httpState->reply_hdr, "\0", 1);
48 httpState->reply_hdr.buf[hdr_size] = '\0';
49 httpState->reply_hdr_state++;
50 assert(httpState->reply_hdr_state == 1);
51- ctx = ctx_enter(entry->mem_obj->url);
52 httpState->reply_hdr_state++;
53 debug(11, 9) ("GOT HTTP REPLY HDR:\n---------\n%s\n----------\n",
54 httpState->reply_hdr.buf);
55--- 430,453 ----
56 if (!memBufIsNull(&httpState->reply_hdr))
57 memBufClean(&httpState->reply_hdr);
58 reply->sline.status = HTTP_HEADER_TOO_LARGE;
59+ httpState->reply_hdr_state += 2;
60+ ctx_exit(ctx);
61 return;
62 }
63 /* headers can be incomplete only if object still arriving */
64 if (!hdr_size) {
65 if (httpState->eof)
66 hdr_size = hdr_len;
67! else {
68! ctx_exit(ctx);
69 return; /* headers not complete */
70+ }
71 }
72 /* Cut away any excess body data (only needed for debug?) */
73 memBufAppend(&httpState->reply_hdr, "\0", 1);
74 httpState->reply_hdr.buf[hdr_size] = '\0';
75 httpState->reply_hdr_state++;
76 assert(httpState->reply_hdr_state == 1);
77 httpState->reply_hdr_state++;
78 debug(11, 9) ("GOT HTTP REPLY HDR:\n---------\n%s\n----------\n",
79 httpState->reply_hdr.buf);
80***************
81*** 453,458 ****
82--- 457,463 ----
83 if (reply->sline.status >= HTTP_INVALID_HEADER) {
84 debug(11, 3) ("httpProcessReplyHeader: Non-HTTP-compliant header: '%s'\n", httpState->reply_hdr.buf);
85 memBufClean(&httpState->reply_hdr);
86+ ctx_exit(ctx);
87 return;
88 }
89 storeTimestampsSet(entry);
This page took 0.117123 seconds and 4 git commands to generate.