Bug 53828

Summary: StreamInbound.closeOutboundConnection(WsFrame) closes with an opcode instead of status
Product: Tomcat 7 Reporter: Michael Newcomb <michael.newcomb>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Severity: minor    
Priority: P2    
Version: trunk   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Michael Newcomb 2012-09-04 16:55:42 UTC
201	private void closeOutboundConnection(WsFrame frame) throws IOException {
202	  try {
203	    getWsOutbound().close(frame);
204	  } finally {
205	    doOnClose(Constants.OPCODE_CLOSE);
206	  }
207	}

Line 205 uses the close opcode instead of a valid status (Constants.STATUS_*).

Not sure of the exact context of this called but it seems to only be called when the last frame from the client was a close frame, thus a Constants.STATUS_NORMAL may be in order.

If not, the frame's opcode could be inspected and mapped to an appropriate status (normal, shutdown, etc...).

Comment 1 Mark Thomas 2012-09-04 20:05:48 UTC
Thanks for the report. Fixed in trunk and 7.0.x and will be included in 7.0.31 onwards.