Merge remote-tracking branch 'origin' into jetty-http2
This commit is contained in:
commit
bb4d42f139
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/7.0.0.v20140317/alpn-boot-7.0.0.v20140317.jar|lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-7.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar|lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/8.0.0.v20140317/alpn-boot-8.0.0.v20140317.jar|lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/alpn/alpn-boot-8.0.0.v20140317.jar
|
||||
|
|
|
@ -24,13 +24,13 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.eclipse.jetty.server.session.AbstractSession;
|
||||
import org.eclipse.jetty.server.session.MemSession;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public class NoSqlSession extends AbstractSession
|
||||
public class NoSqlSession extends MemSession
|
||||
{
|
||||
private final static Logger __log = Log.getLogger("org.eclipse.jetty.server.session");
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
[lib]
|
||||
resources
|
||||
resources/
|
||||
|
||||
[files]
|
||||
resources/
|
||||
|
|
|
@ -21,8 +21,6 @@ package org.eclipse.jetty.server.session;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -54,7 +52,6 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
private String _clusterId; // ID without any node (ie "worker") id appended
|
||||
private String _nodeId; // ID of session with node(ie "worker") id appended
|
||||
private final AbstractSessionManager _manager;
|
||||
private final Map<String,Object> _attributes=new HashMap<String, Object>();
|
||||
private boolean _idChanged;
|
||||
private final long _created;
|
||||
private long _cookieSet;
|
||||
|
@ -139,53 +136,21 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public Map<String,Object> getAttributeMap()
|
||||
{
|
||||
return _attributes;
|
||||
}
|
||||
public abstract Map<String,Object> getAttributeMap();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return _attributes.get(name);
|
||||
}
|
||||
}
|
||||
public abstract int getAttributes();
|
||||
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public int getAttributes()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return _attributes.size();
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public Enumeration<String> getAttributeNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
List<String> names=_attributes==null?Collections.EMPTY_LIST:new ArrayList<String>(_attributes.keySet());
|
||||
return Collections.enumeration(names);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public Set<String> getNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
return new HashSet<String>(_attributes.keySet());
|
||||
}
|
||||
}
|
||||
public abstract Set<String> getNames();
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public long getCookieSetTime()
|
||||
|
@ -272,25 +237,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
return getAttribute(name);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
/**
|
||||
* @deprecated As of Version 2.2, this method is replaced by
|
||||
* {@link #getAttributeNames}
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public String[] getValueNames() throws IllegalStateException
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
checkValid();
|
||||
if (_attributes==null)
|
||||
return new String[0];
|
||||
String[] a=new String[_attributes.size()];
|
||||
return (String[])_attributes.keySet().toArray(a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void renewId(HttpServletRequest request)
|
||||
|
@ -403,34 +350,8 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public void clearAttributes()
|
||||
{
|
||||
while (_attributes!=null && _attributes.size()>0)
|
||||
{
|
||||
ArrayList<String> keys;
|
||||
synchronized(this)
|
||||
{
|
||||
keys=new ArrayList<String>(_attributes.keySet());
|
||||
}
|
||||
|
||||
Iterator<String> iter=keys.iterator();
|
||||
while (iter.hasNext())
|
||||
{
|
||||
String key=(String)iter.next();
|
||||
|
||||
Object value;
|
||||
synchronized(this)
|
||||
{
|
||||
value=doPutOrRemove(key,null);
|
||||
}
|
||||
unbindValue(key,value);
|
||||
|
||||
_manager.doSessionAttributeListeners(this,key,value,null);
|
||||
}
|
||||
}
|
||||
if (_attributes!=null)
|
||||
_attributes.clear();
|
||||
}
|
||||
public abstract void clearAttributes();
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public boolean isIdChanged()
|
||||
|
@ -476,18 +397,65 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
{
|
||||
removeAttribute(name);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public Enumeration<String> getAttributeNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return doGetAttributeNames();
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
/**
|
||||
* @deprecated As of Version 2.2, this method is replaced by
|
||||
* {@link #getAttributeNames}
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public String[] getValueNames() throws IllegalStateException
|
||||
{
|
||||
synchronized(this)
|
||||
{
|
||||
checkValid();
|
||||
Enumeration<String> anames = doGetAttributeNames();
|
||||
if (anames == null)
|
||||
return new String[0];
|
||||
ArrayList<String> names = new ArrayList<String>();
|
||||
while (anames.hasMoreElements())
|
||||
names.add(anames.nextElement());
|
||||
return names.toArray(new String[names.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
protected Object doPutOrRemove(String name, Object value)
|
||||
{
|
||||
return value==null?_attributes.remove(name):_attributes.put(name,value);
|
||||
}
|
||||
public abstract Object doPutOrRemove(String name, Object value);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
protected Object doGet(String name)
|
||||
public abstract Object doGet(String name);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public abstract Enumeration<String> doGetAttributeNames();
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return _attributes.get(name);
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return doGet(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
|
@ -571,12 +539,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
_manager.doSessionAttributeListeners(this,name,oldValue,newValue);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
protected void addAttributes(Map<String,Object> map)
|
||||
{
|
||||
_attributes.putAll(map);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
public void setIdChanged(boolean changed)
|
||||
|
@ -653,7 +616,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
synchronized(this)
|
||||
{
|
||||
HttpSessionEvent event = new HttpSessionEvent(this);
|
||||
for (Iterator<Object> iter = _attributes.values().iterator(); iter.hasNext();)
|
||||
for (Iterator<Object> iter = getAttributeMap().values().iterator(); iter.hasNext();)
|
||||
{
|
||||
Object value = iter.next();
|
||||
if (value instanceof HttpSessionActivationListener)
|
||||
|
@ -671,7 +634,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
|
|||
synchronized(this)
|
||||
{
|
||||
HttpSessionEvent event = new HttpSessionEvent(this);
|
||||
for (Iterator<Object> iter = _attributes.values().iterator(); iter.hasNext();)
|
||||
for (Iterator<Object> iter = getAttributeMap().values().iterator(); iter.hasNext();)
|
||||
{
|
||||
Object value = iter.next();
|
||||
if (value instanceof HttpSessionActivationListener)
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.eclipse.jetty.util.IO;
|
|||
import org.eclipse.jetty.util.log.Log;
|
||||
import org.eclipse.jetty.util.log.Logger;
|
||||
|
||||
public class HashedSession extends AbstractSession
|
||||
public class HashedSession extends MemSession
|
||||
{
|
||||
private static final Logger LOG = Log.getLogger(HashedSession.class);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public class JDBCSessionManager extends AbstractSessionManager
|
|||
*
|
||||
* Session instance.
|
||||
*/
|
||||
public class Session extends AbstractSession
|
||||
public class Session extends MemSession
|
||||
{
|
||||
private static final long serialVersionUID = 5208464051134226143L;
|
||||
|
||||
|
|
|
@ -0,0 +1,146 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.server.session;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
|
||||
/**
|
||||
* MemSession
|
||||
*
|
||||
* A session whose data is kept in memory
|
||||
*/
|
||||
public class MemSession extends AbstractSession
|
||||
{
|
||||
|
||||
private final Map<String,Object> _attributes=new HashMap<String, Object>();
|
||||
|
||||
protected MemSession(AbstractSessionManager abstractSessionManager, HttpServletRequest request)
|
||||
{
|
||||
super(abstractSessionManager, request);
|
||||
}
|
||||
|
||||
public MemSession(AbstractSessionManager abstractSessionManager, long created, long accessed, String clusterId)
|
||||
{
|
||||
super(abstractSessionManager, created, accessed, clusterId);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
@Override
|
||||
public Map<String,Object> getAttributeMap()
|
||||
{
|
||||
return _attributes;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public int getAttributes()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
checkValid();
|
||||
return _attributes.size();
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@SuppressWarnings({ "unchecked" })
|
||||
@Override
|
||||
public Enumeration<String> doGetAttributeNames()
|
||||
{
|
||||
List<String> names=_attributes==null?Collections.EMPTY_LIST:new ArrayList<String>(_attributes.keySet());
|
||||
return Collections.enumeration(names);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Set<String> getNames()
|
||||
{
|
||||
synchronized (this)
|
||||
{
|
||||
return new HashSet<String>(_attributes.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
@Override
|
||||
public void clearAttributes()
|
||||
{
|
||||
while (_attributes!=null && _attributes.size()>0)
|
||||
{
|
||||
ArrayList<String> keys;
|
||||
synchronized(this)
|
||||
{
|
||||
keys=new ArrayList<String>(_attributes.keySet());
|
||||
}
|
||||
|
||||
Iterator<String> iter=keys.iterator();
|
||||
while (iter.hasNext())
|
||||
{
|
||||
String key=(String)iter.next();
|
||||
|
||||
Object value;
|
||||
synchronized(this)
|
||||
{
|
||||
value=doPutOrRemove(key,null);
|
||||
}
|
||||
unbindValue(key,value);
|
||||
|
||||
((AbstractSessionManager)getSessionManager()).doSessionAttributeListeners(this,key,value,null);
|
||||
}
|
||||
}
|
||||
if (_attributes!=null)
|
||||
_attributes.clear();
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void addAttributes(Map<String,Object> map)
|
||||
{
|
||||
_attributes.putAll(map);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object doPutOrRemove(String name, Object value)
|
||||
{
|
||||
return value==null?_attributes.remove(name):_attributes.put(name,value);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public Object doGet(String name)
|
||||
{
|
||||
return _attributes.get(name);
|
||||
}
|
||||
|
||||
}
|
|
@ -21,6 +21,10 @@ package org.eclipse.jetty.server.session;
|
|||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.SessionCookieConfig;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
@ -50,6 +54,96 @@ public class SessionCookieTest
|
|||
super(abstractSessionManager, created, accessed, clusterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpSession#getAttribute(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object getAttribute(String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpSession#getAttributeNames()
|
||||
*/
|
||||
@Override
|
||||
public Enumeration<String> getAttributeNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HttpSession#getValueNames()
|
||||
*/
|
||||
@Override
|
||||
public String[] getValueNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#getAttributeMap()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getAttributeMap()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#getAttributes()
|
||||
*/
|
||||
@Override
|
||||
public int getAttributes()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#getNames()
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#clearAttributes()
|
||||
*/
|
||||
@Override
|
||||
public void clearAttributes()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#doPutOrRemove(java.lang.String, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object doPutOrRemove(String name, Object value)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#doGet(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Object doGet(String name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jetty.server.session.AbstractSession#doGetAttributeNames()
|
||||
*/
|
||||
@Override
|
||||
public Enumeration<String> doGetAttributeNames()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class MockSessionIdManager extends AbstractSessionIdManager
|
||||
|
|
|
@ -38,7 +38,9 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.eclipse.jetty.http.HttpContent;
|
||||
import org.eclipse.jetty.http.HttpField;
|
||||
import org.eclipse.jetty.http.HttpFields;
|
||||
import org.eclipse.jetty.http.HttpGenerator.CachedHttpField;
|
||||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.eclipse.jetty.http.HttpMethod;
|
||||
import org.eclipse.jetty.http.MimeTypes;
|
||||
|
@ -136,6 +138,9 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
private static final Logger LOG = Log.getLogger(DefaultServlet.class);
|
||||
|
||||
private static final long serialVersionUID = 4930458713846881193L;
|
||||
|
||||
private static final CachedHttpField ACCEPT_RANGES = new CachedHttpField(HttpHeader.ACCEPT_RANGES, "bytes");
|
||||
|
||||
private ServletContext _servletContext;
|
||||
private ContextHandler _contextHandler;
|
||||
|
||||
|
@ -155,7 +160,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
private String[] _welcomes;
|
||||
private Resource _stylesheet;
|
||||
private boolean _useFileMappedBuffer=false;
|
||||
private String _cacheControl;
|
||||
private HttpField _cacheControl;
|
||||
private String _relativeResourceBase;
|
||||
private ServletHandler _servletHandler;
|
||||
private ServletHolder _defaultHolder;
|
||||
|
@ -228,8 +233,10 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
LOG.debug(e);
|
||||
}
|
||||
|
||||
_cacheControl=getInitParameter("cacheControl");
|
||||
|
||||
String cc=getInitParameter("cacheControl");
|
||||
if (cc!=null)
|
||||
_cacheControl=new CachedHttpField(HttpHeader.CACHE_CONTROL, cc);
|
||||
|
||||
String resourceCache = getInitParameter("resourceCache");
|
||||
int max_cache_size=getInitInt("maxCacheSize", -2);
|
||||
int max_cached_file_size=getInitInt("maxCachedFileSize", -2);
|
||||
|
@ -1062,10 +1069,10 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
protected void writeOptionHeaders(HttpFields fields)
|
||||
{
|
||||
if (_acceptRanges)
|
||||
fields.put(HttpHeader.ACCEPT_RANGES,"bytes");
|
||||
fields.put(ACCEPT_RANGES);
|
||||
|
||||
if (_cacheControl!=null)
|
||||
fields.put(HttpHeader.CACHE_CONTROL,_cacheControl);
|
||||
fields.put(_cacheControl);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
@ -1075,7 +1082,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory
|
|||
response.setHeader(HttpHeader.ACCEPT_RANGES.asString(),"bytes");
|
||||
|
||||
if (_cacheControl!=null)
|
||||
response.setHeader(HttpHeader.CACHE_CONTROL.asString(),_cacheControl);
|
||||
response.setHeader(HttpHeader.CACHE_CONTROL.asString(),_cacheControl.getValue());
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
protonego-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar|lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
|
|
@ -23,21 +23,25 @@ public class FileArg
|
|||
public String uri;
|
||||
public String location;
|
||||
|
||||
public FileArg(String uriLocation)
|
||||
public FileArg(final String uriLocation)
|
||||
{
|
||||
String parts[] = uriLocation.split(":",3);
|
||||
if (parts.length == 3)
|
||||
String parts[] = uriLocation.split("\\|",3);
|
||||
if (parts.length > 2)
|
||||
{
|
||||
if (!"http".equalsIgnoreCase(parts[0]))
|
||||
{
|
||||
throw new IllegalArgumentException("Download only supports http protocol");
|
||||
}
|
||||
if (!parts[1].startsWith("//"))
|
||||
{
|
||||
throw new IllegalArgumentException("Download URI invalid: " + uriLocation);
|
||||
}
|
||||
this.uri = String.format("%s:%s",parts[0],parts[1]);
|
||||
this.location = parts[2];
|
||||
StringBuilder err = new StringBuilder();
|
||||
final String LN = System.lineSeparator();
|
||||
err.append("Unrecognized [file] argument: ").append(uriLocation);
|
||||
err.append(LN).append("Valid Syntaxes: ");
|
||||
err.append(LN).append(" <relative-path> - eg: resources/");
|
||||
err.append(LN).append(" or <absolute-path> - eg: /var/run/jetty.pid");
|
||||
err.append(LN).append(" or <uri>|<relative-path> - eg: http://machine/my.conf|resources/my.conf");
|
||||
err.append(LN).append(" or <uri>|<absolute-path> - eg: http://machine/glob.dat|/opt/run/glob.dat");
|
||||
throw new IllegalArgumentException(err.toString());
|
||||
}
|
||||
if (parts.length == 2)
|
||||
{
|
||||
this.uri = parts[0];
|
||||
this.location = parts[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.start;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameter;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
public class FileArgTest
|
||||
{
|
||||
@SuppressWarnings("serial")
|
||||
private static class UseCases extends ArrayList<String[]>
|
||||
{
|
||||
public void add(String rawfileref, String expectedUri, String expectedLocation)
|
||||
{
|
||||
this.add(new String[] { rawfileref, expectedUri, expectedLocation });
|
||||
}
|
||||
}
|
||||
|
||||
@Parameters(name = "{0}")
|
||||
public static List<String[]> data()
|
||||
{
|
||||
UseCases data = new UseCases();
|
||||
data.add("resource",null,"resource");
|
||||
data.add("lib/logging",null,"lib/logging");
|
||||
|
||||
// -- URI with relative location --
|
||||
data.add("http://machine.com/my.conf|resources/my.conf","http://machine.com/my.conf","resources/my.conf");
|
||||
data.add("http://machine.com:8080/my.conf|resources/my.conf","http://machine.com:8080/my.conf","resources/my.conf");
|
||||
data.add("https://machine.com:8080/my.conf|resources/my.conf","https://machine.com:8080/my.conf","resources/my.conf");
|
||||
// Windows URI (drive mapped)
|
||||
data.add("file:///Z:/share/my.conf|resources/my.conf","file:///Z:/share/my.conf","resources/my.conf");
|
||||
// Windows URI (network share)
|
||||
data.add("file:////nas/share/my.conf|resources/my.conf","file:////nas/share/my.conf","resources/my.conf");
|
||||
|
||||
// -- URI with absolute location --
|
||||
data.add("http://machine.com/db.dat|/var/run/db.dat","http://machine.com/db.dat","/var/run/db.dat");
|
||||
data.add("http://machine.com:8080/b/db.dat|/var/run/db.dat","http://machine.com:8080/b/db.dat","/var/run/db.dat");
|
||||
data.add("https://machine.com:8080/c/db.dat|/var/run/db.dat","https://machine.com:8080/c/db.dat","/var/run/db.dat");
|
||||
// Windows URI (drive mapped) to drive mapped output
|
||||
data.add("file:///Z:/share/my.conf|C:/db/db.dat","file:///Z:/share/my.conf","C:/db/db.dat");
|
||||
data.add("file:///Z:/share/my.conf|C:\\db\\db.dat","file:///Z:/share/my.conf","C:\\db\\db.dat");
|
||||
// Windows URI (drive mapped) to network share output
|
||||
data.add("file:///Z:/share/my.conf|\\\\nas\\apps\\db\\db.dat","file:///Z:/share/my.conf","\\\\nas\\apps\\db\\db.dat");
|
||||
// Windows URI (network share) to drive mapped output
|
||||
data.add("file:////nas/share/my.conf|C:/db/db.dat","file:////nas/share/my.conf","C:/db/db.dat");
|
||||
data.add("file:////nas/share/my.conf|C:\\db\\db.dat","file:////nas/share/my.conf","C:\\db\\db.dat");
|
||||
// Windows URI (network share) to network share output
|
||||
data.add("file:////nas/share/my.conf|\\\\nas\\apps\\db\\db.dat","file:////nas/share/my.conf","\\\\nas\\apps\\db\\db.dat");
|
||||
return data;
|
||||
}
|
||||
|
||||
@Parameter(value = 0)
|
||||
public String rawFileRef;
|
||||
@Parameter(value = 1)
|
||||
public String expectedUri;
|
||||
@Parameter(value = 2)
|
||||
public String expectedLocation;
|
||||
|
||||
@Test
|
||||
public void testFileArg()
|
||||
{
|
||||
FileArg arg = new FileArg(rawFileRef);
|
||||
if (expectedUri == null)
|
||||
{
|
||||
assertThat("URI",arg.uri,nullValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
assertThat("URI",arg.uri,is(expectedUri));
|
||||
}
|
||||
assertThat("Location",arg.location,is(expectedLocation));
|
||||
}
|
||||
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.0.v20120525/npn-boot-1.1.0.v20120525.jar|lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.0.v20120525.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.1.v20121030/npn-boot-1.1.1.v20121030.jar|lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.1.v20121030.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.3.v20130313/npn-boot-1.1.3.v20130313.jar|lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.3.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.4.v20130313/npn-boot-1.1.4.v20130313.jar|lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.4.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.5.v20130313/npn-boot-1.1.5.v20130313.jar|lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.5.v20130313.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.6.v20130911/npn-boot-1.1.6.v20130911.jar|lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.6.v20130911.jar
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
npn-boot
|
||||
|
||||
[files]
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
http://central.maven.org/maven2/org/mortbay/jetty/npn/npn-boot/1.1.7.v20140316/npn-boot-1.1.7.v20140316.jar|lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
||||
[exec]
|
||||
-Xbootclasspath/p:lib/npn/npn-boot-1.1.7.v20140316.jar
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.5,2.0)";resolution:=optional,org.slf4j.impl;version="[1.5,2.0)";resolution:=optional,*</Import-Package>
|
||||
<Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.slf4j;version="[1.6,2.0)";resolution:=optional,org.slf4j.impl;version="[1.6,2.0)";resolution:=optional,*</Import-Package>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
|
|
@ -66,6 +66,15 @@ public class SharedBlockingCallback
|
|||
return "SUCCEEDED";
|
||||
}
|
||||
};
|
||||
|
||||
private static Throwable FAILED = new Throwable()
|
||||
{
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "FAILED";
|
||||
}
|
||||
};
|
||||
|
||||
final Blocker _blocker;
|
||||
|
||||
|
@ -148,7 +157,10 @@ public class SharedBlockingCallback
|
|||
{
|
||||
if (_state == null)
|
||||
{
|
||||
_state = cause;
|
||||
// TODO remove before release
|
||||
if (cause==null)
|
||||
LOG.warn("null failed cause ",new Throwable());
|
||||
_state = cause==null?FAILED:cause;
|
||||
_complete.signalAll();
|
||||
}
|
||||
else if (_state == IDLE)
|
||||
|
|
|
@ -20,8 +20,6 @@ package org.eclipse.jetty.websocket.jsr356;
|
|||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
import org.junit.Ignore;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
|
@ -59,7 +57,6 @@ import org.junit.Before;
|
|||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
@Ignore
|
||||
public class DecoderReaderTest
|
||||
{
|
||||
public static class Quotes
|
||||
|
@ -262,8 +259,8 @@ public class DecoderReaderTest
|
|||
client.connectToServer(quoter,server.getWsUri());
|
||||
qserver.awaitConnect();
|
||||
qserver.writeQuotes("quotes-ben.txt");
|
||||
qserver.close();
|
||||
quoter.messageQueue.awaitEventCount(1,1000,TimeUnit.MILLISECONDS);
|
||||
qserver.close();
|
||||
quoter.awaitClose();
|
||||
Quotes quotes = quoter.messageQueue.poll();
|
||||
Assert.assertThat("Quotes Author",quotes.author,is("Benjamin Franklin"));
|
||||
|
@ -280,8 +277,8 @@ public class DecoderReaderTest
|
|||
qserver.awaitConnect();
|
||||
qserver.writeQuotes("quotes-ben.txt");
|
||||
qserver.writeQuotes("quotes-twain.txt");
|
||||
qserver.close();
|
||||
quoter.messageQueue.awaitEventCount(2,1000,TimeUnit.MILLISECONDS);
|
||||
qserver.close();
|
||||
quoter.awaitClose();
|
||||
Quotes quotes = quoter.messageQueue.poll();
|
||||
Assert.assertThat("Quotes Author",quotes.author,is("Benjamin Franklin"));
|
||||
|
|
|
@ -144,7 +144,6 @@ public class ConfiguratorTest
|
|||
@Override
|
||||
public String getNegotiatedSubprotocol(List<String> supported, List<String> requested)
|
||||
{
|
||||
LOG.warn(new Throwable());
|
||||
String seen = QuoteUtil.join(requested,",");
|
||||
seenProtocols.compareAndSet(null,seen);
|
||||
return super.getNegotiatedSubprotocol(supported,requested);
|
||||
|
|
|
@ -27,11 +27,10 @@ import org.eclipse.jetty.toolchain.test.TestTracker;
|
|||
import org.eclipse.jetty.websocket.api.Session;
|
||||
import org.eclipse.jetty.websocket.api.StatusCode;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer.ServerConnection;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -104,7 +103,6 @@ public class BadNetworkTest
|
|||
wsocket.assertCloseCode(StatusCode.NO_CLOSE);
|
||||
}
|
||||
|
||||
@Ignore("Idle timeout not working yet")
|
||||
@Test
|
||||
public void testAbruptServerClose() throws Exception
|
||||
{
|
||||
|
|
|
@ -18,10 +18,7 @@
|
|||
|
||||
package org.eclipse.jetty.websocket.client;
|
||||
|
||||
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ConnectException;
|
||||
|
@ -40,12 +37,11 @@ import org.eclipse.jetty.websocket.api.Session;
|
|||
import org.eclipse.jetty.websocket.api.UpgradeException;
|
||||
import org.eclipse.jetty.websocket.common.AcceptHash;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.eclipse.jetty.websocket.common.test.BlockheadServer.ServerConnection;
|
||||
import org.eclipse.jetty.websocket.common.test.LeakTrackingBufferPool;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -311,7 +307,6 @@ public class ClientConnectTest
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Opened bug 399525")
|
||||
public void testConnectionNotAccepted() throws Exception
|
||||
{
|
||||
JettyTrackingSocket wsocket = new JettyTrackingSocket();
|
||||
|
@ -329,7 +324,6 @@ public class ClientConnectTest
|
|||
}
|
||||
catch (ExecutionException e)
|
||||
{
|
||||
// FIXME: Connect Timeout Error?
|
||||
assertExpectedError(e,wsocket,UpgradeException.class);
|
||||
// Possible Passing Path (active session wait timeout)
|
||||
wsocket.assertNotOpened();
|
||||
|
|
|
@ -7,7 +7,7 @@ org.eclipse.jetty.LEVEL=WARN
|
|||
# org.eclipse.jetty.io.FillInterest.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.io.AbstractConnection.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.LEVEL=WARN
|
||||
org.eclipse.jetty.websocket.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.client.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.LEVEL=DEBUG
|
||||
# org.eclipse.jetty.websocket.common.io.IOState.LEVEL=DEBUG
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
|
||||
// ------------------------------------------------------------------------
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
//
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
//
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package org.eclipse.jetty.websocket.common.extensions.compress;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.zip.Deflater;
|
||||
|
||||
import org.eclipse.jetty.util.StringUtil;
|
||||
import org.eclipse.jetty.websocket.common.util.Hex;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class DeflateTest
|
||||
{
|
||||
private int bufSize = 8 * 1024;
|
||||
|
||||
public String deflate(String inputHex, Deflater deflater, int flushMode)
|
||||
{
|
||||
byte uncompressed[] = Hex.asByteArray(inputHex);
|
||||
deflater.reset();
|
||||
deflater.setInput(uncompressed,0,uncompressed.length);
|
||||
if (flushMode != Deflater.SYNC_FLUSH)
|
||||
deflater.finish();
|
||||
|
||||
ByteBuffer out = ByteBuffer.allocate(bufSize);
|
||||
byte buf[] = new byte[64];
|
||||
|
||||
int len = deflater.deflate(buf,0,buf.length,flushMode);
|
||||
out.put(buf,0,len);
|
||||
|
||||
out.flip();
|
||||
return Hex.asHex(out);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("noisy")
|
||||
public void deflateAllTypes()
|
||||
{
|
||||
int levels[] = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
|
||||
boolean nowraps[] = new boolean[] { true, false };
|
||||
int strategies[] = new int[] { Deflater.DEFAULT_STRATEGY, Deflater.FILTERED, Deflater.HUFFMAN_ONLY };
|
||||
int flushmodes[] = new int[] { Deflater.NO_FLUSH, Deflater.SYNC_FLUSH, Deflater.FULL_FLUSH };
|
||||
|
||||
String inputHex = Hex.asHex(StringUtil.getUtf8Bytes("time:"));
|
||||
for (int level : levels)
|
||||
{
|
||||
for (boolean nowrap : nowraps)
|
||||
{
|
||||
Deflater deflater = new Deflater(level,nowrap);
|
||||
for (int strategy : strategies)
|
||||
{
|
||||
deflater.setStrategy(strategy);
|
||||
for (int flushmode : flushmodes)
|
||||
{
|
||||
String result = deflate(inputHex,deflater,flushmode);
|
||||
System.out.printf("%d | %b | %d | %d | \"%s\"%n",level,nowrap,strategy,flushmode,result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,10 +31,8 @@ import org.eclipse.jetty.websocket.server.helper.EchoServlet;
|
|||
import org.junit.AfterClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@Ignore("Bug 395444")
|
||||
public class FragmentExtensionTest
|
||||
{
|
||||
private static SimpleServletServer server;
|
||||
|
|
|
@ -31,10 +31,8 @@ import org.eclipse.jetty.websocket.server.helper.EchoServlet;
|
|||
import org.junit.AfterClass;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
@Ignore("Bug 395444")
|
||||
public class IdentityExtensionTest
|
||||
{
|
||||
private static SimpleServletServer server;
|
||||
|
|
12
pom.xml
12
pom.xml
|
@ -14,7 +14,7 @@
|
|||
<jetty.url>http://www.eclipse.org/jetty</jetty.url>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<build-support-version>1.1</build-support-version>
|
||||
<slf4j-version>1.6.1</slf4j-version>
|
||||
<slf4j-version>1.6.6</slf4j-version>
|
||||
<jetty-test-policy-version>1.2</jetty-test-policy-version>
|
||||
<npn.api.version>1.1.0.v20120525</npn.api.version>
|
||||
<alpn.api.version>1.0.0</alpn.api.version>
|
||||
|
@ -261,12 +261,18 @@
|
|||
<configuration>
|
||||
<argLine>-showversion -Xmx1g -Xms1g -XX:+PrintGCDetails</argLine>
|
||||
<failIfNoTests>false</failIfNoTests>
|
||||
<!--systemProperties>
|
||||
<systemProperties>
|
||||
<!--
|
||||
<property>
|
||||
<name>org.eclipse.jetty.io.AbstractBuffer.boundsChecking</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</systemProperties-->
|
||||
-->
|
||||
<property>
|
||||
<name>java.io.tmpdir</name>
|
||||
<value>${project.build.directory}</value>
|
||||
</property>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-sessions-parent</artifactId>
|
||||
<version>9.1.1-SNAPSHOT</version>
|
||||
<version>9.2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>test-mongodb-sessions</artifactId>
|
||||
<name>Jetty Tests :: Sessions :: Mongo</name>
|
||||
|
|
Loading…
Reference in New Issue