|
|
|
@ -51,6 +51,7 @@ import org.springframework.web.socket.sockjs.transport.SockJsServiceConfig;
@@ -51,6 +51,7 @@ import org.springframework.web.socket.sockjs.transport.SockJsServiceConfig;
|
|
|
|
|
*/ |
|
|
|
|
public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession { |
|
|
|
|
|
|
|
|
|
private final Queue<String> messageCache; |
|
|
|
|
|
|
|
|
|
private volatile URI uri; |
|
|
|
|
|
|
|
|
@ -64,20 +65,13 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
@@ -64,20 +65,13 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
|
|
|
|
|
|
|
|
|
|
private volatile String acceptedProtocol; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private volatile ServerHttpResponse response; |
|
|
|
|
|
|
|
|
|
private volatile SockJsFrameFormat frameFormat; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private volatile ServerHttpAsyncRequestControl asyncRequestControl; |
|
|
|
|
|
|
|
|
|
private final Object responseLock = new Object(); |
|
|
|
|
|
|
|
|
|
private volatile boolean readyToSend; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Queue<String> messageCache; |
|
|
|
|
private boolean readyToSend; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AbstractHttpSockJsSession(String id, SockJsServiceConfig config, |
|
|
|
@ -209,14 +203,10 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
@@ -209,14 +203,10 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
|
|
|
|
|
this.frameFormat = frameFormat; |
|
|
|
|
this.asyncRequestControl = request.getAsyncRequestControl(response); |
|
|
|
|
this.asyncRequestControl.start(-1); |
|
|
|
|
|
|
|
|
|
disableShallowEtagHeaderFilter(request); |
|
|
|
|
|
|
|
|
|
// Let "our" handler know before sending the open frame to the remote handler
|
|
|
|
|
delegateConnectionEstablished(); |
|
|
|
|
|
|
|
|
|
handleRequestInternal(request, response, true); |
|
|
|
|
|
|
|
|
|
// Request might have been reset (e.g. polling sessions do after writing)
|
|
|
|
|
this.readyToSend = isActive(); |
|
|
|
|
} |
|
|
|
@ -252,9 +242,7 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
@@ -252,9 +242,7 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
|
|
|
|
|
this.frameFormat = frameFormat; |
|
|
|
|
this.asyncRequestControl = request.getAsyncRequestControl(response); |
|
|
|
|
this.asyncRequestControl.start(-1); |
|
|
|
|
|
|
|
|
|
disableShallowEtagHeaderFilter(request); |
|
|
|
|
|
|
|
|
|
handleRequestInternal(request, response, false); |
|
|
|
|
this.readyToSend = isActive(); |
|
|
|
|
} |
|
|
|
@ -318,14 +306,11 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
@@ -318,14 +306,11 @@ public abstract class AbstractHttpSockJsSession extends AbstractSockJsSession {
|
|
|
|
|
|
|
|
|
|
protected void resetRequest() { |
|
|
|
|
synchronized (this.responseLock) { |
|
|
|
|
|
|
|
|
|
ServerHttpAsyncRequestControl control = this.asyncRequestControl; |
|
|
|
|
this.asyncRequestControl = null; |
|
|
|
|
this.readyToSend = false; |
|
|
|
|
this.response = null; |
|
|
|
|
|
|
|
|
|
updateLastActiveTime(); |
|
|
|
|
|
|
|
|
|
if (control != null && !control.isCompleted()) { |
|
|
|
|
if (control.isStarted()) { |
|
|
|
|
try { |
|
|
|
|