306880 - Support for UPGRADE in HttpClient
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1408 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
a21a29b6a9
commit
203d692be0
|
@ -1,6 +1,7 @@
|
|||
jetty-7.0.2.SNAPSHOT
|
||||
+ 306783 - NPE in StdErrLog when Throwable is null
|
||||
+ 306840 - Suppress content-length in requests with no content
|
||||
+ 306880 - Support for UPGRADE in HttpClient
|
||||
+ 306884 - Suspend with timeout <=0 never expires
|
||||
|
||||
jetty-7.0.2.RC0
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.jetty.http.HttpHeaders;
|
|||
import org.eclipse.jetty.http.HttpMethods;
|
||||
import org.eclipse.jetty.http.HttpParser;
|
||||
import org.eclipse.jetty.http.HttpSchemes;
|
||||
import org.eclipse.jetty.http.HttpStatus;
|
||||
import org.eclipse.jetty.http.HttpVersions;
|
||||
import org.eclipse.jetty.http.ssl.SslSelectChannelEndPoint;
|
||||
import org.eclipse.jetty.io.Buffer;
|
||||
|
@ -49,6 +50,7 @@ public class HttpConnection implements Connection
|
|||
private HttpGenerator _generator;
|
||||
private HttpParser _parser;
|
||||
private boolean _http11 = true;
|
||||
private int _status;
|
||||
private Buffer _connectionHeader;
|
||||
private Buffer _requestContentChunk;
|
||||
private boolean _requestComplete;
|
||||
|
@ -332,6 +334,22 @@ public class HttpConnection implements Connection
|
|||
{
|
||||
_exchange.disassociate();
|
||||
_exchange = null;
|
||||
|
||||
if (_status==HttpStatus.SWITCHING_PROTOCOLS_101)
|
||||
{
|
||||
HttpConnection switched=_exchange.onSwitchProtocol(_endp);
|
||||
if (switched!=null)
|
||||
{
|
||||
// switched protocol!
|
||||
HttpExchange exchange = _pipeline;
|
||||
_pipeline = null;
|
||||
if (exchange!=null)
|
||||
_destination.send(exchange);
|
||||
|
||||
return switched;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (_pipeline == null)
|
||||
{
|
||||
|
@ -356,6 +374,7 @@ public class HttpConnection implements Connection
|
|||
send(exchange);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -398,6 +417,7 @@ public class HttpConnection implements Connection
|
|||
{
|
||||
synchronized (this)
|
||||
{
|
||||
_status=0;
|
||||
if (_exchange.getStatus() != HttpExchange.STATUS_WAITING_FOR_COMMIT)
|
||||
throw new IllegalStateException();
|
||||
|
||||
|
@ -500,6 +520,7 @@ public class HttpConnection implements Connection
|
|||
if (exchange!=null)
|
||||
{
|
||||
_http11 = HttpVersions.HTTP_1_1_BUFFER.equals(version);
|
||||
_status=status;
|
||||
exchange.getEventListener().onResponseStatus(version,status,reason);
|
||||
exchange.setStatus(HttpExchange.STATUS_PARSING_HEADERS);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.eclipse.jetty.http.HttpSchemes;
|
|||
import org.eclipse.jetty.http.HttpURI;
|
||||
import org.eclipse.jetty.http.HttpVersions;
|
||||
import org.eclipse.jetty.io.Buffer;
|
||||
import org.eclipse.jetty.io.EndPoint;
|
||||
import org.eclipse.jetty.io.BufferCache.CachedBuffer;
|
||||
import org.eclipse.jetty.io.ByteArrayBuffer;
|
||||
import org.eclipse.jetty.util.log.Log;
|
||||
|
@ -656,6 +657,13 @@ public class HttpExchange
|
|||
return getClass().getSimpleName() + "@" + hashCode() + "=" + _method + "//" + _address + _uri + "#" + getStatus();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
protected HttpConnection onSwitchProtocol(EndPoint enpd) throws IOException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback called when the request headers have been sent to the server.
|
||||
* This implementation does nothing.
|
||||
|
|
Loading…
Reference in New Issue