Issue #3666 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
e5a6910be4
commit
6681da7e74
|
@ -176,10 +176,7 @@ public class CloseStatus
|
|||
public static boolean isOrdinary(CloseStatus closeStatus)
|
||||
{
|
||||
int code = closeStatus.getCode();
|
||||
if (code == NORMAL || code == NO_CODE || code >= 3000)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
return (code == NORMAL || code == NO_CODE || code >= 3000);
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
|
|
|
@ -114,16 +114,13 @@ public class FrameFlusher extends IteratingCallback
|
|||
{
|
||||
case OpCode.CLOSE:
|
||||
closeStatus = CloseStatus.getCloseStatus(frame);
|
||||
if (CloseStatus.isOrdinary(closeStatus))
|
||||
queue.offerLast(entry);
|
||||
else
|
||||
if (!CloseStatus.isOrdinary(closeStatus))
|
||||
{
|
||||
//fail all existing entries in the queue, and enqueue the close frame
|
||||
//fail all existing entries in the queue, and enqueue the error close
|
||||
failedEntries = new ArrayList<>(queue);
|
||||
queue.clear();
|
||||
queue.offerFirst(entry);
|
||||
}
|
||||
|
||||
queue.offerLast(entry);
|
||||
this.canEnqueue = false;
|
||||
break;
|
||||
|
||||
|
@ -157,8 +154,7 @@ public class FrameFlusher extends IteratingCallback
|
|||
if (closeStatus instanceof AbnormalCloseStatus)
|
||||
{
|
||||
Throwable cause = ((AbnormalCloseStatus)closeStatus).getCause();
|
||||
if (cause != null)
|
||||
failure.addSuppressed(cause);
|
||||
failure.initCause(cause);
|
||||
}
|
||||
|
||||
for (Entry e : failedEntries)
|
||||
|
|
Loading…
Reference in New Issue