]> git.pld-linux.org Git - packages/squid.git/blob - squid-2.5.STABLE10-STORE_PENDING.patch
- updated to 2.5.STABLE13
[packages/squid.git] / squid-2.5.STABLE10-STORE_PENDING.patch
1 Index: squid/src/cache_manager.c
2 diff -c squid/src/cache_manager.c:1.26.2.1 squid/src/cache_manager.c:1.26.2.2
3 *** squid/src/cache_manager.c:1.26.2.1  Thu Sep  1 16:14:45 2005
4 --- squid/src/cache_manager.c   Thu Sep  1 16:42:03 2005
5 ***************
6 *** 251,258 ****
7       /* retrieve object requested */
8       a = cachemgrFindAction(mgr->action);
9       assert(a != NULL);
10 !     if (a->flags.atomic)
11 !       storeBuffer(entry);
12       {
13         http_version_t version;
14         HttpReply *rep = entry->mem_obj->reply;
15 --- 251,257 ----
16       /* retrieve object requested */
17       a = cachemgrFindAction(mgr->action);
18       assert(a != NULL);
19 !     storeBuffer(entry);
20       {
21         http_version_t version;
22         HttpReply *rep = entry->mem_obj->reply;
23 ***************
24 *** 270,279 ****
25         httpReplySwapOut(rep, entry);
26       }
27       a->handler(entry);
28 !     if (a->flags.atomic) {
29 !       storeBufferFlush(entry);
30         storeComplete(entry);
31 -     }
32       cachemgrStateFree(mgr);
33   }
34   
35 --- 269,277 ----
36         httpReplySwapOut(rep, entry);
37       }
38       a->handler(entry);
39 !     storeBufferFlush(entry);
40 !     if (a->flags.atomic)
41         storeComplete(entry);
42       cachemgrStateFree(mgr);
43   }
44   
45 Index: squid/src/ftp.c
46 diff -c squid/src/ftp.c:1.316.2.30 squid/src/ftp.c:1.316.2.31
47 *** squid/src/ftp.c:1.316.2.30  Thu Sep  1 16:28:29 2005
48 --- squid/src/ftp.c     Thu Sep  1 16:42:03 2005
49 ***************
50 *** 369,375 ****
51       char *dirup;
52       int i, j, k;
53       const char *title = strBuf(ftpState->title_url);
54 -     storeBuffer(e);
55       storeAppendPrintf(e, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
56       storeAppendPrintf(e, "<!-- HTML listing generated by Squid %s -->\n",
57         version_string);
58 --- 369,374 ----
59 ***************
60 *** 429,435 ****
61       storeAppendPrintf(e, "<PRE>\n");
62       dirup = ftpHtmlifyListEntry("<internal-dirup>", ftpState);
63       storeAppend(e, dirup, strlen(dirup));
64 -     storeBufferFlush(e);
65       ftpState->flags.html_header_sent = 1;
66   }
67   
68 --- 428,433 ----
69 ***************
70 *** 437,443 ****
71   ftpListingFinish(FtpStateData * ftpState)
72   {
73       StoreEntry *e = ftpState->entry;
74 -     storeBuffer(e);
75       storeAppendPrintf(e, "</PRE>\n");
76       if (ftpState->flags.listformat_unknown && !ftpState->flags.tried_nlst) {
77         storeAppendPrintf(e, "<A HREF=\"%s/;type=d\">[As plain directory]</A>\n",
78 --- 435,440 ----
79 ***************
80 *** 453,459 ****
81         getMyHostname(),
82         full_appname_string);
83       storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n");
84 -     storeBufferFlush(e);
85   }
86   
87   static const char *Month[] =
88 --- 450,455 ----
89 ***************
90 *** 869,875 ****
91       debug(9, 3) ("ftpParseListing: %d bytes to play with\n", (int) len);
92       line = memAllocate(MEM_4K_BUF);
93       end++;
94 !     storeBuffer(e);
95       s = sbuf;
96       s += strspn(s, crlf);
97       for (; s < end; s += strcspn(s, crlf), s += strspn(s, crlf)) {
98 --- 865,871 ----
99       debug(9, 3) ("ftpParseListing: %d bytes to play with\n", (int) len);
100       line = memAllocate(MEM_4K_BUF);
101       end++;
102 !     storeBuffer(e);           /* released when done processing current data payload */
103       s = sbuf;
104       s += strspn(s, crlf);
105       for (; s < end; s += strcspn(s, crlf), s += strspn(s, crlf)) {
106 ***************
107 *** 887,893 ****
108         assert(t != NULL);
109         storeAppend(e, t, strlen(t));
110       }
111 -     storeBufferFlush(e);
112       assert(usable <= len);
113       if (usable < len) {
114         /* must copy partial line to beginning of buf */
115 --- 883,888 ----
116 ***************
117 *** 992,997 ****
118 --- 987,993 ----
119             storeAppend(entry, ftpState->data.buf, len);
120             ftpState->data.offset = 0;
121         }
122 +       storeBufferFlush(entry);
123         commSetSelect(fd,
124             COMM_SELECT_READ,
125             ftpDataRead,
126 ***************
127 *** 2544,2550 ****
128       else
129         err->ftp.reply = xstrdup("");
130       errorAppendEntry(ftpState->entry, err);
131 -     storeBufferFlush(ftpState->entry);
132       ftpSendQuit(ftpState);
133   }
134   
135 --- 2540,2545 ----
136 ***************
137 *** 2565,2570 ****
138 --- 2560,2566 ----
139       ftpState->flags.http_header_sent = 1;
140       assert(e->mem_obj->inmem_hi == 0);
141       EBIT_CLR(e->flags, ENTRY_FWD_HDR_WAIT);
142 +     storeBuffer(e);           /* released when done processing current data payload */
143       filename = (t = strRChr(urlpath, '/')) ? t + 1 : strBuf(urlpath);
144       if (ftpState->flags.isdir) {
145         mime_type = "text/html";
146 ***************
147 *** 2583,2589 ****
148             break;
149         }
150       }
151 -     storeBuffer(e);
152       httpReplyReset(reply);
153       /* set standard stuff */
154       if (ftpState->restarted_offset) {
155 --- 2579,2584 ----
156 ***************
157 *** 2605,2611 ****
158       if (mime_enc)
159         httpHeaderPutStr(&reply->header, HDR_CONTENT_ENCODING, mime_enc);
160       httpReplySwapOut(reply, e);
161 -     storeBufferFlush(e);
162       reply->hdr_sz = e->mem_obj->inmem_hi;
163       storeTimestampsSet(e);
164       if (ftpState->flags.authenticated) {
165 --- 2600,2605 ----
166 Index: squid/src/gopher.c
167 diff -c squid/src/gopher.c:1.162.2.9 squid/src/gopher.c:1.162.2.10
168 *** squid/src/gopher.c:1.162.2.9        Thu Sep  1 16:14:45 2005
169 --- squid/src/gopher.c  Thu Sep  1 16:42:03 2005
170 ***************
171 *** 721,749 ****
172        * OK. We successfully reach remote site.  Start MIME typing
173        * stuff.  Do it anyway even though request is not HTML type.
174        */
175       gopherMimeCreate(gopherState);
176       switch (gopherState->type_id) {
177       case GOPHER_DIRECTORY:
178         /* we got to convert it first */
179 -       storeBuffer(entry);
180         gopherState->conversion = HTML_DIR;
181         gopherState->HTML_header_added = 0;
182         break;
183       case GOPHER_INDEX:
184         /* we got to convert it first */
185 -       storeBuffer(entry);
186         gopherState->conversion = HTML_INDEX_RESULT;
187         gopherState->HTML_header_added = 0;
188         break;
189       case GOPHER_CSO:
190         /* we got to convert it first */
191 -       storeBuffer(entry);
192         gopherState->conversion = HTML_CSO_RESULT;
193         gopherState->cso_recno = 0;
194         gopherState->HTML_header_added = 0;
195         break;
196       default:
197         gopherState->conversion = NORMAL;
198       }
199       /* Schedule read reply. */
200       commSetSelect(fd, COMM_SELECT_READ, gopherReadReply, gopherState, 0);
201 --- 721,748 ----
202        * OK. We successfully reach remote site.  Start MIME typing
203        * stuff.  Do it anyway even though request is not HTML type.
204        */
205 +     storeBuffer(entry);
206       gopherMimeCreate(gopherState);
207       switch (gopherState->type_id) {
208       case GOPHER_DIRECTORY:
209         /* we got to convert it first */
210         gopherState->conversion = HTML_DIR;
211         gopherState->HTML_header_added = 0;
212         break;
213       case GOPHER_INDEX:
214         /* we got to convert it first */
215         gopherState->conversion = HTML_INDEX_RESULT;
216         gopherState->HTML_header_added = 0;
217         break;
218       case GOPHER_CSO:
219         /* we got to convert it first */
220         gopherState->conversion = HTML_CSO_RESULT;
221         gopherState->cso_recno = 0;
222         gopherState->HTML_header_added = 0;
223         break;
224       default:
225         gopherState->conversion = NORMAL;
226 +       storeBufferFlush(entry);
227       }
228       /* Schedule read reply. */
229       commSetSelect(fd, COMM_SELECT_READ, gopherReadReply, gopherState, 0);
230 Index: squid/src/store.c
231 diff -c squid/src/store.c:1.544.2.8 squid/src/store.c:1.544.2.9
232 *** squid/src/store.c:1.544.2.8 Fri Mar 25 19:50:53 2005
233 --- squid/src/store.c   Thu Sep  1 16:42:03 2005
234 ***************
235 *** 1232,1240 ****
236   void
237   storeBufferFlush(StoreEntry * e)
238   {
239 !     EBIT_CLR(e->flags, DELAY_SENDING);
240 !     InvokeHandlers(e);
241 !     storeSwapOut(e);
242   }
243   
244   squid_off_t
245 --- 1232,1242 ----
246   void
247   storeBufferFlush(StoreEntry * e)
248   {
249 !     if (EBIT_TEST(e->flags, DELAY_SENDING)) {
250 !       EBIT_CLR(e->flags, DELAY_SENDING);
251 !       InvokeHandlers(e);
252 !       storeSwapOut(e);
253 !     }
254   }
255   
256   squid_off_t
257 Index: squid/src/whois.c
258 diff -c squid/src/whois.c:1.16.2.1 squid/src/whois.c:1.16.2.2
259 *** squid/src/whois.c:1.16.2.1  Thu Sep  1 16:14:45 2005
260 --- squid/src/whois.c   Thu Sep  1 16:42:03 2005
261 ***************
262 *** 97,108 ****
263       debug(75, 3) ("whoisReadReply: FD %d read %d bytes\n", fd, len);
264       debug(75, 5) ("{%s}\n", buf);
265       if (len > 0) {
266 !       if (0 == mem->inmem_hi)
267 !           mem->reply->sline.status = HTTP_OK;
268         fd_bytes(fd, len, FD_READ);
269         kb_incr(&statCounter.server.all.kbytes_in, len);
270         kb_incr(&statCounter.server.http.kbytes_in, len);
271         storeAppend(entry, buf, len);
272         commSetSelect(fd, COMM_SELECT_READ, whoisReadReply, p, Config.Timeout.read);
273       } else if (len < 0) {
274         debug(50, 2) ("whoisReadReply: FD %d: read failure: %s.\n",
275 --- 97,115 ----
276       debug(75, 3) ("whoisReadReply: FD %d read %d bytes\n", fd, len);
277       debug(75, 5) ("{%s}\n", buf);
278       if (len > 0) {
279 !       if (0 == mem->inmem_hi) {
280 !           http_reply *reply = mem->reply;
281 !           http_version_t version;
282 !           storeBuffer(entry);
283 !           httpBuildVersion(&version, 1, 0);
284 !           httpReplySetHeaders(reply, version, HTTP_OK, "Gatewaying", "text/plain", -1, -1, -2);
285 !           httpReplySwapOut(reply, entry);
286 !       }
287         fd_bytes(fd, len, FD_READ);
288         kb_incr(&statCounter.server.all.kbytes_in, len);
289         kb_incr(&statCounter.server.http.kbytes_in, len);
290         storeAppend(entry, buf, len);
291 +       storeBufferFlush(entry);
292         commSetSelect(fd, COMM_SELECT_READ, whoisReadReply, p, Config.Timeout.read);
293       } else if (len < 0) {
294         debug(50, 2) ("whoisReadReply: FD %d: read failure: %s.\n",
This page took 0.179093 seconds and 3 git commands to generate.