Merge remote-tracking branch 'origin/jetty-8'

Conflicts:
	jetty-client/src/test/java/org/eclipse/jetty/client/WebSocketUpgradeTest.java
	jetty-security/src/main/java/org/eclipse/jetty/security/SecurityHandler.java
	jetty-server/src/main/java/org/eclipse/jetty/server/session/HashSessionManager.java
	jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD00.java
	jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketFactory.java
	jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketServlet.java
	jetty-websocket/src/test/java/org/eclipse/jetty/websocket/SafariWebsocketDraft0Test.java
	jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD08Test.java
	jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadRFC6455Test.java
	jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD00Test.java
	jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java
	jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD08Test.java
	jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketServletRFCTest.java
This commit is contained in:
Jan Bartel 2012-11-05 17:27:49 +11:00
commit 2acdf9f839
2 changed files with 19 additions and 10 deletions

View File

@ -70,7 +70,7 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
private Authenticator.Factory _authenticatorFactory=new DefaultAuthenticatorFactory();
private String _realmName;
private String _authMethod;
private final Map<String,String> _initParameters=new HashMap<>();
private final Map<String,String> _initParameters=new HashMap<String,String>();
private LoginService _loginService;
private IdentityService _identityService;
private boolean _renewSession=true;
@ -355,6 +355,7 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
if (_identityService==null && _realmName!=null)
setIdentityService(new DefaultIdentityService());
_discoveredIdentityService = true;
}
@ -382,6 +383,7 @@ public abstract class SecurityHandler extends HandlerWrapper implements Authenti
}
@Override
/* ------------------------------------------------------------ */
protected void doStop() throws Exception
{
//if we discovered the services (rather than had them explicitly configured), remove them.

View File

@ -513,33 +513,40 @@ public class HashSessionManager extends AbstractSessionManager
protected synchronized HashedSession restoreSession(String idInCuster)
{
File file = new File(_storeDir,idInCuster);
FileInputStream in = null;
Exception error = null;
try
{
if (file.exists())
{
FileInputStream in = new FileInputStream(file);
in = new FileInputStream(file);
HashedSession session = restoreSession(in, null);
in.close();
addSession(session, false);
session.didActivate();
file.delete();
return session;
}
}
catch (Exception e)
{
if (isDeleteUnrestorableSessions())
error = e;
}
finally
{
if (in != null)
try {in.close();} catch (Exception x) {__log.ignore(x);}
if (error != null)
{
if (file.exists())
if (isDeleteUnrestorableSessions() && file.exists())
{
file.delete();
LOG.warn("Deleting file for unrestorable session "+idInCuster, e);
LOG.warn("Deleting file for unrestorable session "+idInCuster, error);
}
else
LOG.warn("Problem restoring session "+idInCuster, error);
}
else
LOG.warn("Problem restoring session "+idInCuster, e);
file.delete(); //delete successfully restored file
}
return null;
}