Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-10.0.x
This commit is contained in:
commit
42e46aee49
|
@ -395,6 +395,8 @@ public class HpackContext
|
|||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug(String.format("HdrTbl[%x] evictAll", HpackContext.this.hashCode()));
|
||||
if (size() > 0)
|
||||
{
|
||||
_fieldMap.clear();
|
||||
_nameMap.clear();
|
||||
_offset = 0;
|
||||
|
@ -403,6 +405,7 @@ public class HpackContext
|
|||
Arrays.fill(_entries, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class Entry
|
||||
{
|
||||
|
|
|
@ -467,7 +467,7 @@ public abstract class AbstractSessionCache extends ContainerLifeCycle implements
|
|||
{
|
||||
//only write the session out at this point if the attributes changed. If only
|
||||
//the lastAccess/expiry time changed defer the write until the last request exits
|
||||
if (session.getSessionData().isDirty() && _flushOnResponseCommit)
|
||||
if (session.isValid() && session.getSessionData().isDirty() && _flushOnResponseCommit)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Flush session {} on response commit", session);
|
||||
|
|
|
@ -54,6 +54,7 @@ public class RemoveSessionTest
|
|||
String servletMapping = "/server";
|
||||
|
||||
DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
|
||||
cacheFactory.setFlushOnResponseCommit(true);
|
||||
cacheFactory.setEvictionPolicy(SessionCache.NEVER_EVICT);
|
||||
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
|
||||
|
||||
|
@ -94,6 +95,9 @@ public class RemoveSessionTest
|
|||
assertEquals(1, ((DefaultSessionCache)m.getSessionCache()).getSessionsMax());
|
||||
assertEquals(1, ((DefaultSessionCache)m.getSessionCache()).getSessionsTotal());
|
||||
|
||||
//check the session is no longer in the cache
|
||||
assertFalse(((AbstractSessionCache)m.getSessionCache()).contains(TestServer.extractSessionId(sessionCookie)));
|
||||
|
||||
//check the session is not persisted any more
|
||||
assertFalse(m.getSessionCache().getSessionDataStore().exists(TestServer.extractSessionId(sessionCookie)));
|
||||
|
||||
|
@ -125,7 +129,8 @@ public class RemoveSessionTest
|
|||
String action = request.getParameter("action");
|
||||
if ("create".equals(action))
|
||||
{
|
||||
request.getSession(true);
|
||||
HttpSession s = request.getSession(true);
|
||||
s.setAttribute("foo", "bar");
|
||||
}
|
||||
else if ("delete".equals(action))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue