//
// ========================================================================
-// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
+// Copyright (c) 1995-2016 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
{
private static final Logger LOG = Log.getLogger(HttpChannelState.class);
- private final static long DEFAULT_TIMEOUT=30000L;
+ private final static long DEFAULT_TIMEOUT=Long.getLong("org.eclipse.jetty.server.HttpChannelState.DEFAULT_TIMEOUT",30000L);
/** The dispatched state of the HttpChannel, used to control the overall livecycle
*/
ASYNC_WOKEN, // A thread has been dispatch to handle from ASYNCWAIT
ASYNC_IO, // Has been dispatched for async IO
COMPLETING, // Request is completable
- COMPLETED // Request is complete
+ COMPLETED, // Request is complete
+ UPGRADED // Request upgraded the connection
}
/**
case DISPATCHED:
case ASYNC_IO:
throw new IllegalStateException(getStatusString());
+ case UPGRADED:
+ return;
default:
break;
}
_event=null;
}
}
+
+ public void upgrade()
+ {
+ synchronized (this)
+ {
+ switch(_state)
+ {
+ case IDLE:
+ case COMPLETED:
+ break;
+ default:
+ throw new IllegalStateException(getStatusString());
+ }
+ _asyncListeners=null;
+ _state=State.UPGRADED;
+ _async=null;
+ _initial=true;
+ _asyncRead=false;
+ _asyncWrite=false;
+ _timeoutMs=DEFAULT_TIMEOUT;
+ cancelTimeout();
+ _event=null;
+ }
+ }
+
protected void scheduleDispatch()
{