--------------------- PatchSet 8956 Date: 2007/02/26 10:36:49 Author: adri Branch: storework Tag: (none) Log: Make errorpage generation work again; apply HttpReply body content too * I wasn't appending HttpReply body content to the store; this was done in the old code and is used in generating errorpages. Fix this up. * fix errorpage code to use storeReply() and hack around the client-side reply changing. We're not consuming it anymore; we're instead making sure that the passed rep == mem_obj->reply for now. That'll go away once the code is sane. Members: src/errorpage.c:1.36->1.36.2.1 src/store.c:1.45.2.6->1.45.2.7 Index: squid/src/errorpage.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/errorpage.c,v retrieving revision 1.36 retrieving revision 1.36.2.1 diff -u -r1.36 -r1.36.2.1 --- squid/src/errorpage.c 21 Jan 2007 14:03:46 -0000 1.36 +++ squid/src/errorpage.c 26 Feb 2007 10:36:49 -0000 1.36.2.1 @@ -1,6 +1,6 @@ /* - * $Id: errorpage.c,v 1.36 2007/01/21 14:03:46 squidadm Exp $ + * $Id: errorpage.c,v 1.36.2.1 2007/02/26 10:36:49 adri Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -322,7 +322,13 @@ * on 407/401 responses, and do not check the accel state on 401/407 responses */ authenticateFixHeader(rep, err->auth_user_request, err->request, 0, 1); - httpReplySwapOut(rep, entry); + /* XXX There's an existing mem_obj->reply which needs to be gotten rid of */ + if (entry->mem_obj->reply) { + httpReplyDestroy(entry->mem_obj->reply); + entry->mem_obj->reply = NULL; + entry->mem_obj->reply = rep; + } + storeReply(entry, rep); EBIT_CLR(entry->flags, ENTRY_FWD_HDR_WAIT); storeNegativeCache(entry); storeReleaseRequest(entry); Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.45.2.6 retrieving revision 1.45.2.7 diff -u -r1.45.2.6 -r1.45.2.7 --- squid/src/store.c 25 Feb 2007 13:26:33 -0000 1.45.2.6 +++ squid/src/store.c 26 Feb 2007 10:36:50 -0000 1.45.2.7 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.45.2.6 2007/02/25 13:26:33 adri Exp $ + * $Id: store.c,v 1.45.2.7 2007/02/26 10:36:50 adri Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1438,6 +1438,12 @@ assert(e->mem_obj->reply == rep); e->mem_obj->flags.have_reply = 1; + /* if there's a body then append it manually here. */ + /* XXX is this body MemBuf freed elsewhere? */ + if (rep->body.mb.size > 0) { + storeAppend(e, rep->body.mb.buf, rep->body.mb.size); + } + /* * At this point we can schedule a callback for the store clients who are * awaiting a HTTP reply.