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
7 /* retrieve object requested */
8 a = cachemgrFindAction(mgr->action);
10 ! if (a->flags.atomic)
13 http_version_t version;
14 HttpReply *rep = entry->mem_obj->reply;
16 /* retrieve object requested */
17 a = cachemgrFindAction(mgr->action);
21 http_version_t version;
22 HttpReply *rep = entry->mem_obj->reply;
25 httpReplySwapOut(rep, entry);
28 ! if (a->flags.atomic) {
29 ! storeBufferFlush(entry);
32 cachemgrStateFree(mgr);
36 httpReplySwapOut(rep, entry);
39 ! storeBufferFlush(entry);
40 ! if (a->flags.atomic)
42 cachemgrStateFree(mgr);
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
53 const char *title = strBuf(ftpState->title_url);
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",
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;
71 ftpListingFinish(FtpStateData * ftpState)
73 StoreEntry *e = ftpState->entry;
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",
83 storeAppendPrintf(e, "</ADDRESS></BODY></HTML>\n");
84 - storeBufferFlush(e);
87 static const char *Month[] =
91 debug(9, 3) ("ftpParseListing: %d bytes to play with\n", (int) len);
92 line = memAllocate(MEM_4K_BUF);
97 for (; s < end; s += strcspn(s, crlf), s += strspn(s, crlf)) {
99 debug(9, 3) ("ftpParseListing: %d bytes to play with\n", (int) len);
100 line = memAllocate(MEM_4K_BUF);
102 ! storeBuffer(e); /* released when done processing current data payload */
104 s += strspn(s, crlf);
105 for (; s < end; s += strcspn(s, crlf), s += strspn(s, crlf)) {
109 storeAppend(e, t, strlen(t));
111 - storeBufferFlush(e);
112 assert(usable <= len);
114 /* must copy partial line to beginning of buf */
119 storeAppend(entry, ftpState->data.buf, len);
120 ftpState->data.offset = 0;
122 + storeBufferFlush(entry);
129 err->ftp.reply = xstrdup("");
130 errorAppendEntry(ftpState->entry, err);
131 - storeBufferFlush(ftpState->entry);
132 ftpSendQuit(ftpState);
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";
152 httpReplyReset(reply);
153 /* set standard stuff */
154 if (ftpState->restarted_offset) {
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) {
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
172 * OK. We successfully reach remote site. Start MIME typing
173 * stuff. Do it anyway even though request is not HTML type.
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;
184 /* we got to convert it first */
185 - storeBuffer(entry);
186 gopherState->conversion = HTML_INDEX_RESULT;
187 gopherState->HTML_header_added = 0;
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;
197 gopherState->conversion = NORMAL;
199 /* Schedule read reply. */
200 commSetSelect(fd, COMM_SELECT_READ, gopherReadReply, gopherState, 0);
202 * OK. We successfully reach remote site. Start MIME typing
203 * stuff. Do it anyway even though request is not HTML type.
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;
214 /* we got to convert it first */
215 gopherState->conversion = HTML_INDEX_RESULT;
216 gopherState->HTML_header_added = 0;
219 /* we got to convert it first */
220 gopherState->conversion = HTML_CSO_RESULT;
221 gopherState->cso_recno = 0;
222 gopherState->HTML_header_added = 0;
225 gopherState->conversion = NORMAL;
226 + storeBufferFlush(entry);
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
237 storeBufferFlush(StoreEntry * e)
239 ! EBIT_CLR(e->flags, DELAY_SENDING);
247 storeBufferFlush(StoreEntry * e)
249 ! if (EBIT_TEST(e->flags, DELAY_SENDING)) {
250 ! EBIT_CLR(e->flags, DELAY_SENDING);
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
263 debug(75, 3) ("whoisReadReply: FD %d read %d bytes\n", fd, len);
264 debug(75, 5) ("{%s}\n", buf);
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",
276 debug(75, 3) ("whoisReadReply: FD %d read %d bytes\n", fd, len);
277 debug(75, 5) ("{%s}\n", buf);
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);
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",