--------------------- PatchSet 11483 Date: 2007/06/23 20:54:00 Author: hno Branch: HEAD Tag: (none) Log: Bug #1994: act-as-origin http_port option segfaults on IMS hits Members: src/client_side.c:1.722->1.723 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid/squid/src/client_side.c,v retrieving revision 1.722 retrieving revision 1.723 diff -u -r1.722 -r1.723 --- squid/src/client_side.c 24 Apr 2007 14:59:28 -0000 1.722 +++ squid/src/client_side.c 23 Jun 2007 20:54:00 -0000 1.723 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.722 2007/04/24 14:59:28 hno Exp $ + * $Id: client_side.c,v 1.723 2007/06/23 20:54:00 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1906,7 +1906,7 @@ httpHeaderDelById(hdr, HDR_DATE); httpHeaderInsertTime(hdr, 0, HDR_DATE, squid_curtime); h = httpHeaderFindEntry(hdr, HDR_EXPIRES); - if (h) { + if (h && http->entry->expires >= 0) { httpHeaderPutExt(hdr, "X-Origin-Expires", strBuf(h->value)); httpHeaderDelById(hdr, HDR_EXPIRES); httpHeaderInsertTime(hdr, 1, HDR_EXPIRES, squid_curtime + http->entry->expires - http->entry->timestamp); @@ -2299,9 +2299,10 @@ * Copy timestamp from the original entry so the 304 * reply has a meaningful Age: header. */ - e->timestamp = timestamp; http->entry = e; httpReplyParse(e->mem_obj->reply, mb.buf, mb.size); + storeTimestampsSet(e); + e->timestamp = timestamp; storeAppend(e, mb.buf, mb.size); memBufClean(&mb); storeComplete(e);