From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason at zx2c4.com (Jason A. Donenfeld) Date: Thu, 6 Feb 2014 20:52:46 +0100 Subject: [PATCH 1/2] Skip cache slot when time-to-live is zero In-Reply-To: <1391593564-10662-2-git-send-email-cgit@cryptocrack.de> References: <1391593564-10662-1-git-send-email-cgit@cryptocrack.de> <1391593564-10662-2-git-send-email-cgit@cryptocrack.de> Message-ID: On Wed, Feb 5, 2014 at 10:46 AM, Lukas Fleischer wrote: > > /* If the cache is disabled, just generate the content */ > - if (size <= 0) { > + if (size <= 0 || ttl == 0) { > fn(); > return 0; > } Apparently we already special case ttl for < 0: /* Check if the slot has expired */ static int is_expired(struct cache_slot *slot) { if (slot->ttl < 0) return 0; else return slot->cache_st.st_mtime + slot->ttl * 60 < time(NULL); } What should our behavior be for consistency? -------------- next part -------------- An HTML attachment was scrubbed... URL: