View | Details | Raw Unified | Return to bug 59189
Collapse All | Expand All

(-)apache-tomcat-7.0.68-src-orig/java/org/apache/tomcat/websocket/PerMessageDeflate.java (+9 lines)
Lines 439-444 Link Here
439
        }
439
        }
440
    }
440
    }
441
441
442
    @Override
443
    public void close() {
444
        if (next != null) {
445
            next.close();
446
        }
447
        deflater.end();
448
        inflater.end();
449
    }
450
442
451
443
    private void startNewMessage() {
452
    private void startNewMessage() {
444
        firstCompressedFrameWritten = false;
453
        firstCompressedFrameWritten = false;
(-)apache-tomcat-7.0.68-src-orig/java/org/apache/tomcat/websocket/server/WsHttpUpgradeHandler.java (-1 / +1 lines)
Lines 129-135 Link Here
129
                    handshakeRequest.getQueryString(),
129
                    handshakeRequest.getQueryString(),
130
                    handshakeRequest.getUserPrincipal(), httpSessionId,
130
                    handshakeRequest.getUserPrincipal(), httpSessionId,
131
                    negotiatedExtensions, subProtocol, pathParameters, secure,
131
                    negotiatedExtensions, subProtocol, pathParameters, secure,
132
                    endpointConfig);
132
                    endpointConfig, transformation);
133
            WsFrameServer wsFrame = new WsFrameServer(sis, wsSession, transformation);
133
            WsFrameServer wsFrame = new WsFrameServer(sis, wsSession, transformation);
134
            sos.setWriteListener(new WsWriteListener(this, wsRemoteEndpointServer));
134
            sos.setWriteListener(new WsWriteListener(this, wsRemoteEndpointServer));
135
            // WsFrame adds the necessary final transformations. Copy the
135
            // WsFrame adds the necessary final transformations. Copy the
(-)apache-tomcat-7.0.68-src-orig/java/org/apache/tomcat/websocket/Transformation.java (+5 lines)
Lines 94-97 Link Here
94
     *          may be bigger or smaller than the size of the input list
94
     *          may be bigger or smaller than the size of the input list
95
     */
95
     */
96
    List<MessagePart> sendMessagePart(List<MessagePart> messageParts);
96
    List<MessagePart> sendMessagePart(List<MessagePart> messageParts);
97
98
    /**
99
     * Close this transformation. Performs any cleanup needed.
100
     */
101
    void close();
97
}
102
}
(-)apache-tomcat-7.0.68-src-orig/java/org/apache/tomcat/websocket/WsFrameBase.java (+12 lines)
Lines 777-782 Link Here
777
            // NO-OP send so simply return the message unchanged.
777
            // NO-OP send so simply return the message unchanged.
778
            return messageParts;
778
            return messageParts;
779
        }
779
        }
780
781
782
        @Override
783
        public void close() {
784
            // NO-OP, nothing needed
785
        }
780
    }
786
    }
781
787
782
788
Lines 818-822 Link Here
818
            // NO-OP send so simply return the message unchanged.
824
            // NO-OP send so simply return the message unchanged.
819
            return messageParts;
825
            return messageParts;
820
        }
826
        }
827
828
829
        @Override
830
        public void close() {
831
            // NO-OP, nothing needed
832
        }
821
    }
833
    }
822
}
834
}
(-)apache-tomcat-7.0.68-src-orig/java/org/apache/tomcat/websocket/WsSession.java (-1 / +6 lines)
Lines 84-89 Link Here
84
    private final boolean secure;
84
    private final boolean secure;
85
    private final String httpSessionId;
85
    private final String httpSessionId;
86
    private final String id;
86
    private final String id;
87
    private final Transformation transformation;
87
88
88
    // Expected to handle message types of <String> only
89
    // Expected to handle message types of <String> only
89
    private MessageHandler textMessageHandler = null;
90
    private MessageHandler textMessageHandler = null;
Lines 119-125 Link Here
119
            URI requestUri, Map<String,List<String>> requestParameterMap,
120
            URI requestUri, Map<String,List<String>> requestParameterMap,
120
            String queryString, Principal userPrincipal, String httpSessionId,
121
            String queryString, Principal userPrincipal, String httpSessionId,
121
            List<Extension> negotiatedExtensions, String subProtocol, Map<String,String> pathParameters,
122
            List<Extension> negotiatedExtensions, String subProtocol, Map<String,String> pathParameters,
122
            boolean secure, EndpointConfig endpointConfig) throws DeploymentException {
123
            boolean secure, EndpointConfig endpointConfig, Transformation transformation) throws DeploymentException {
123
        this.localEndpoint = localEndpoint;
124
        this.localEndpoint = localEndpoint;
124
        this.wsRemoteEndpoint = wsRemoteEndpoint;
125
        this.wsRemoteEndpoint = wsRemoteEndpoint;
125
        this.wsRemoteEndpoint.setSession(this);
126
        this.wsRemoteEndpoint.setSession(this);
Lines 157-162 Link Here
157
158
158
        this.userProperties.putAll(endpointConfig.getUserProperties());
159
        this.userProperties.putAll(endpointConfig.getUserProperties());
159
        this.id = Long.toHexString(ids.getAndIncrement());
160
        this.id = Long.toHexString(ids.getAndIncrement());
161
        this.transformation = transformation;
160
162
161
        InstanceManager instanceManager = webSocketContainer.getInstanceManager();
163
        InstanceManager instanceManager = webSocketContainer.getInstanceManager();
162
        if (instanceManager != null) {
164
        if (instanceManager != null) {
Lines 498-503 Link Here
498
500
499
                // Close the socket
501
                // Close the socket
500
                wsRemoteEndpoint.close();
502
                wsRemoteEndpoint.close();
503
504
                // Close the transformation
505
                transformation.close();
501
            }
506
            }
502
        }
507
        }
503
    }
508
    }
(-)apache-tomcat-7.0.68-src-orig/java/org/apache/tomcat/websocket/WsWebSocketContainer.java (-1 / +1 lines)
Lines 457-463 Link Here
457
        WsSession wsSession = new WsSession(endpoint, wsRemoteEndpointClient,
457
        WsSession wsSession = new WsSession(endpoint, wsRemoteEndpointClient,
458
                this, null, null, null, null, null, extensionsAgreed,
458
                this, null, null, null, null, null, extensionsAgreed,
459
                subProtocol, Collections.<String,String>emptyMap(), secure,
459
                subProtocol, Collections.<String,String>emptyMap(), secure,
460
                clientEndpointConfiguration);
460
                clientEndpointConfiguration, transformation);
461
461
462
        WsFrameClient wsFrameClient = new WsFrameClient(response, channel,
462
        WsFrameClient wsFrameClient = new WsFrameClient(response, channel,
463
                wsSession, transformation);
463
                wsSession, transformation);

Return to bug 59189