From: Alex Rousskov Date: Wed, 1 Jan 2014 19:20:49 +0000 (-0700) Subject: Merged from trunk 13199. X-Git-Tag: SQUID_3_5_0_1~444^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b481492ba35c00365794e7ea823d4b0f9f0933e5;p=thirdparty%2Fsquid.git Merged from trunk 13199. --- b481492ba35c00365794e7ea823d4b0f9f0933e5 diff --cc src/Makefile.am index 25b1358de2,f39833ce91..fa354c6c73 --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -3709,6 -3675,45 +3714,46 @@@ tests_testSBuf_LDADD= $(COMMON_LIBS) tests_testSBuf_DEPENDENCIES= $(SQUID_CPPUNIT_LA) + tests_testSBufList_SOURCES= \ + tests/testSBufList.h \ + tests/testSBufList.cc \ + tests/testMain.cc \ + $(SBUF_SOURCE) \ + SBufList.h \ + SBufList.cc \ + SBufAlgos.h \ + SBufDetailedStats.h \ + tests/stub_SBufDetailedStats.cc \ + SBufStream.h \ + tests/stub_time.cc \ + mem.cc \ + tests/stub_debug.cc \ + tests/stub_event.cc \ + tests/stub_fatal.cc \ + tests/stub_HelperChildConfig.cc \ + tests/stub_cache_cf.cc \ + tests/stub_cache_manager.cc \ ++ tests/stub_store.cc \ + tests/stub_store_stats.cc \ + tests/stub_tools.cc \ + SquidString.h \ + String.cc \ + tests/stub_wordlist.cc \ + tests/stub_MemBuf.cc + nodist_tests_testSBufList_SOURCES=$(TESTSOURCES) + tests_testSBufList_LDFLAGS = $(LIBADD_DL) + tests_testSBufList_LDADD=\ + $(SQUID_CPPUNIT_LIBS) \ + $(SQUID_CPPUNIT_LA) \ + $(COMPAT_LIB) \ + libsquid.la \ + ip/libip.la \ + mgr/libmgr.la \ + base/libbase.la \ + $(top_builddir)/lib/libmiscutil.la \ + $(COMMON_LIBS) + tests_testSBufList_DEPENDENCIES= $(SQUID_CPPUNIT_LA) + tests_testConfigParser_SOURCES = \ ClientInfo.h \ Mem.h \ diff --cc src/Server.cc index 295bb5509c,5cbb391c02..8438cd2978 --- a/src/Server.cc +++ b/src/Server.cc @@@ -174,6 -175,8 +175,8 @@@ ServerStateData::setFinalReply(HttpRepl // give entry the reply because haveParsedReplyHeaders() expects it there entry->replaceHttpReply(theFinalReply, false); // but do not write yet haveParsedReplyHeaders(); // update the entry/reply (e.g., set timestamps) - if (EBIT_TEST(entry->flags, ENTRY_CACHABLE) && blockCaching()) ++ if (!EBIT_TEST(entry->flags, RELEASE_REQUEST) && blockCaching()) + entry->release(); entry->startWriting(); // write the updated entry to store return theFinalReply; diff --cc src/client_side_reply.h index ac1e369cea,7cebe1cc7b..29f72ac71a --- a/src/client_side_reply.h +++ b/src/client_side_reply.h @@@ -140,7 -140,7 +140,8 @@@ private void triggerInitialStoreRead(); void sendClientOldEntry(); void purgeAllCached(); + void forgetHit(); + bool blockedHit() const; void sendBodyTooLargeError(); void sendPreconditionFailedError(); diff --cc src/format/Format.cc index 366a8b1163,f6d903c6f2..f15ff7596c --- a/src/format/Format.cc +++ b/src/format/Format.cc @@@ -496,11 -496,11 +496,11 @@@ Format::Format::assemble(MemBuf &mb, co break; case LFT_TIME_START: { - int precision = fmt->widthMax >=0 ? fmt->widthMax :3; - snprintf(tmp, sizeof(tmp), "%0*" PRId64 ".%0*d", fmt->zero && (fmt->widthMin - precision - 1 >= 0) ? fmt->widthMin - precision - 1 : 0, (int64_t)al->cache.start_time.tv_sec, precision, (int)(al->cache.start_time.tv_usec / fmt->divisor)); + int precision = fmt->widthMax >=0 ? fmt->widthMax : 3; + snprintf(tmp, sizeof(tmp), "%0*" PRId64 ".%0*d", fmt->zero && (fmt->widthMin - precision - 1 >= 0) ? fmt->widthMin - precision - 1 : 0, static_cast(al->cache.start_time.tv_sec), precision, (int)(al->cache.start_time.tv_usec / fmt->divisor)); out = tmp; } - break; + break; case LFT_TIME_TO_HANDLE_REQUEST: outint = al->cache.msec;