X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2FHttpChannelState.java;h=c0cfa2f06b477e1b1334d0c07732b64b0ec45405;hp=7ff4d5a2a47a4ed49c0f4805b4552b52c0da0c0e;hb=ba4f228fa9f72d50991a2218cfd83987ef5d385e;hpb=875b5e9651498a0cd8e0001c0742ba843e47cad0 diff --git a/lib/jetty/org/eclipse/jetty/server/HttpChannelState.java b/lib/jetty/org/eclipse/jetty/server/HttpChannelState.java index 7ff4d5a2..c0cfa2f0 100644 --- a/lib/jetty/org/eclipse/jetty/server/HttpChannelState.java +++ b/lib/jetty/org/eclipse/jetty/server/HttpChannelState.java @@ -1,6 +1,6 @@ // // ======================================================================== -// 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 @@ -40,7 +40,7 @@ public class HttpChannelState { 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 */ @@ -52,7 +52,8 @@ public class HttpChannelState 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 } /** @@ -525,6 +526,8 @@ public class HttpChannelState case DISPATCHED: case ASYNC_IO: throw new IllegalStateException(getStatusString()); + case UPGRADED: + return; default: break; } @@ -539,6 +542,31 @@ public class HttpChannelState _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() {