Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit916b8aa

Browse files
committed
Drop UPGRADE State,closeAsyncHttpClient#1347
Motivation:The UPGRADE State is only returned by `WebSocketUpgradeHandler::onStatusReceived` which is internal and that can only return 2 values,so it could return CONTINUE instead.Modifications:* Drop UPGRADE* Use CONTINUE insteadResult:More simple code
1 parent97bc355 commit916b8aa

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

‎client/src/main/java/org/asynchttpclient/AsyncHandler.java‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ enum State {
5858
/**
5959
* Continue the processing
6060
*/
61-
CONTINUE,
62-
/**
63-
* Upgrade the protocol.
64-
*/
65-
UPGRADE
61+
CONTINUE
6662
}
6763

6864
/**

‎client/src/main/java/org/asynchttpclient/netty/handler/WebSocketHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void call() throws Exception {
9090
if (connection ==null)
9191
connection =response.headers().get(CONNECTION);
9292
booleanvalidConnection =HttpHeaderValues.UPGRADE.contentEqualsIgnoreCase(connection);
93-
booleanstatusReceived =handler.onStatusReceived(status) ==State.UPGRADE;
93+
booleanstatusReceived =handler.onStatusReceived(status) ==State.CONTINUE;
9494

9595
if (!statusReceived) {
9696
try {

‎client/src/main/java/org/asynchttpclient/ws/WebSocketUpgradeHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public final State onBodyPartReceived(HttpResponseBodyPart bodyPart) throws Exce
6767
@Override
6868
publicfinalStateonStatusReceived(HttpResponseStatusresponseStatus)throwsException {
6969
status =responseStatus.getStatusCode();
70-
returnstatus ==SWITCHING_PROTOCOLS ?State.UPGRADE :State.ABORT;
70+
returnstatus ==SWITCHING_PROTOCOLS ?State.CONTINUE :State.ABORT;
7171
}
7272

7373
@Override

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp