src/java.net.http/share/classes/jdk/internal/net/http/websocket/WebSocketImpl.java
branchhttp-client-branch
changeset 56341 10fcbe13cd19
parent 56337 58e16ad3fb98
child 56389 0ba90c4f1e3f
equal deleted inserted replaced
56340:245debd8398a 56341:10fcbe13cd19
   290         // output in place. Otherwise the number of Close messages in queue
   290         // output in place. Otherwise the number of Close messages in queue
   291         // would not be bounded.
   291         // would not be bounded.
   292         if (!isLegalToSendFromClient(statusCode)) {
   292         if (!isLegalToSendFromClient(statusCode)) {
   293             result = failedFuture(new IllegalArgumentException("statusCode"));
   293             result = failedFuture(new IllegalArgumentException("statusCode"));
   294         } else if (!isLegalReason(reason)) {
   294         } else if (!isLegalReason(reason)) {
   295             result = failedFuture(new IOException("reason"));
   295             result = failedFuture(new IllegalArgumentException("reason"));
   296         } else if (!outputClosed.compareAndSet(false, true)){
   296         } else if (!outputClosed.compareAndSet(false, true)){
   297             result = failedFuture(new IOException("Output closed"));
   297             result = failedFuture(new IOException("Output closed"));
   298         } else {
   298         } else {
   299             result = sendClose0(statusCode, reason);
   299             result = sendClose0(statusCode, reason);
   300         }
   300         }