|
31 | 31 | import com.ning.http.client.HttpResponseStatus;
|
32 | 32 | import com.ning.http.client.ListenableFuture;
|
33 | 33 | import com.ning.http.client.MaxRedirectException;
|
34 |
| -import com.ning.http.client.Part; |
35 | 34 | import com.ning.http.client.PerRequestConfig;
|
36 | 35 | import com.ning.http.client.ProxyServer;
|
37 | 36 | import com.ning.http.client.Realm;
|
|
102 | 101 | import org.glassfish.grizzly.utils.Futures;
|
103 | 102 | import org.glassfish.grizzly.utils.IdleTimeoutFilter;
|
104 | 103 | import org.glassfish.grizzly.websockets.DataFrame;
|
105 |
| -import org.glassfish.grizzly.websockets.DefaultWebSocket; |
106 | 104 | import org.glassfish.grizzly.websockets.HandShake;
|
107 | 105 | import org.glassfish.grizzly.websockets.HandshakeException;
|
108 | 106 | import org.glassfish.grizzly.websockets.ProtocolHandler;
|
| 107 | +import org.glassfish.grizzly.websockets.SimpleWebSocket; |
109 | 108 | import org.glassfish.grizzly.websockets.Version;
|
110 |
| -import org.glassfish.grizzly.websockets.WebSocketEngine; |
111 | 109 | import org.glassfish.grizzly.websockets.WebSocketFilter;
|
| 110 | +import org.glassfish.grizzly.websockets.WebSocketHolder; |
112 | 111 | import org.glassfish.grizzly.websockets.draft06.ClosingFrame;
|
113 | 112 | import org.slf4j.Logger;
|
114 | 113 | import org.slf4j.LoggerFactory;
|
@@ -1295,13 +1294,13 @@ protected void onHttpHeadersParsed(HttpHeader httpHeader,
|
1295 | 1294 | context.protocolHandler.setConnection(ctx.getConnection());
|
1296 | 1295 | final GrizzlyWebSocketAdapter webSocketAdapter = createWebSocketAdapter(context);
|
1297 | 1296 | context.webSocket = webSocketAdapter;
|
1298 |
| - DefaultWebSocket ws = webSocketAdapter.gWebSocket; |
| 1297 | + SimpleWebSocket ws = webSocketAdapter.gWebSocket; |
1299 | 1298 | if (context.currentState == AsyncHandler.STATE.UPGRADE) {
|
1300 | 1299 | httpHeader.setChunked(false);
|
1301 | 1300 | ws.onConnect();
|
1302 |
| - WebSocketEngine.getEngine().setWebSocketHolder(ctx.getConnection(), |
1303 |
| - context.protocolHandler, |
1304 |
| - ws); |
| 1301 | + WebSocketHolder.set(ctx.getConnection(), |
| 1302 | + context.protocolHandler, |
| 1303 | + ws); |
1305 | 1304 | ((WebSocketUpgradeHandler) context.handler).onSuccess(context.webSocket);
|
1306 | 1305 | final int wsTimeout = context.provider.clientConfig.getWebSocketIdleTimeoutInMs();
|
1307 | 1306 | IdleTimeoutFilter.setCustomTimeout(ctx.getConnection(),
|
@@ -1388,7 +1387,7 @@ protected boolean onHttpPacketParsed(HttpHeader httpHeader, FilterChainContext c
|
1388 | 1387 | // ----------------------------------------------------- Private Methods
|
1389 | 1388 |
|
1390 | 1389 | private static GrizzlyWebSocketAdapter createWebSocketAdapter(final HttpTransactionContext context) {
|
1391 |
| - DefaultWebSocket ws = new DefaultWebSocket(context.protocolHandler); |
| 1390 | + SimpleWebSocket ws = new SimpleWebSocket(context.protocolHandler); |
1392 | 1391 | AsyncHttpProviderConfig config = context.provider.clientConfig.getAsyncHttpProviderConfig();
|
1393 | 1392 | boolean bufferFragments = true;
|
1394 | 1393 | if (config instanceof GrizzlyAsyncHttpProviderConfig) {
|
@@ -2576,13 +2575,13 @@ public void getBytes(byte[] bytes) {
|
2576 | 2575 |
|
2577 | 2576 | private static final class GrizzlyWebSocketAdapter implements WebSocket {
|
2578 | 2577 |
|
2579 |
| - final DefaultWebSocket gWebSocket; |
| 2578 | + final SimpleWebSocket gWebSocket; |
2580 | 2579 | final boolean bufferFragments;
|
2581 | 2580 |
|
2582 | 2581 | // -------------------------------------------------------- Constructors
|
2583 | 2582 |
|
2584 | 2583 |
|
2585 |
| - GrizzlyWebSocketAdapter(final DefaultWebSocket gWebSocket, |
| 2584 | + GrizzlyWebSocketAdapter(final SimpleWebSocket gWebSocket, |
2586 | 2585 | final boolean bufferFragments) {
|
2587 | 2586 | this.gWebSocket = gWebSocket;
|
2588 | 2587 | this.bufferFragments = bufferFragments;
|
|
0 commit comments