--------------------- PatchSet 2455 Date: 2001/06/01 15:54:42 Author: hno Branch: etag Tag: (none) Log: Handle If-None-Match on cache validations Members: src/client_side.c:1.29.2.10->1.29.2.11 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.29.2.10 retrieving revision 1.29.2.11 diff -u -r1.29.2.10 -r1.29.2.11 --- squid/src/client_side.c 1 Jun 2001 15:24:36 -0000 1.29.2.10 +++ squid/src/client_side.c 1 Jun 2001 15:54:42 -0000 1.29.2.11 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.29.2.10 2001/06/01 15:24:36 hno Exp $ + * $Id: client_side.c,v 1.29.2.11 2001/06/01 15:54:42 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -551,6 +551,20 @@ debug(33, 5) ("clientGetsOldEntry: NO, reply=%d\n", status); return 0; } + /* If the ETag matches the clients If-None-Match, then return + * the servers 304 reply + */ + if (httpHeaderHas(&new_entry->mem_obj->reply->header, HDR_ETAG) && + httpHeaderHas(&request->header, HDR_IF_NONE_MATCH)) { + const char *etag = httpHeaderGetStr(&new_entry->mem_obj->reply->header, HDR_ETAG); + String etags = httpHeaderGetList(&request->header, HDR_IF_NONE_MATCH); + int etag_match = strListIsMember(&etags, etag, ','); + stringClean(&etags); + if (etag_match) { + debug(33, 5) ("clientGetsOldEntry: NO, client If-None-Match\n"); + return 0; + } + } /* If the client did not send IMS in the request, then it * must get the old object, not this "Not Modified" reply */ if (!request->flags.ims) {