Skip to content

Commit

Permalink
Revert "fix #4660: incrementing the fetch for ping/pong"
Browse files Browse the repository at this point in the history
This reverts commit 6d6d440.
  • Loading branch information
vietj committed Apr 14, 2023
1 parent 6d6d440 commit 967008a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
4 changes: 0 additions & 4 deletions src/main/java/io/vertx/core/http/impl/WebSocketImplBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,6 @@ private void receiveFrame(WebSocketFrameInternal frame) {
context.dispatch(frame.binaryData(), handler);
}
break;
case PING:
case PONG:
fetch(1);
break;
}
}

Expand Down
25 changes: 0 additions & 25 deletions src/test/java/io/vertx/core/http/WebSocketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2480,31 +2480,6 @@ public void testServerWebSocketPingPong() {
}));
await();
}

@Test
public void testWebSocketPausePing() throws InterruptedException {
server = vertx.createHttpServer(new HttpServerOptions().setIdleTimeout(1).setPort(DEFAULT_HTTP_PORT).setHost(HttpTestBase.DEFAULT_HTTP_HOST));
server.webSocketHandler(ws -> {
ws.pongHandler(buff -> {
assertEquals("ping", buff.toString());
ws.close();
});
ws.writePing(Buffer.buffer("ping"));
}).listen(onSuccess(v -> {
client = vertx.createHttpClient();
client.webSocket(DEFAULT_HTTP_PORT, HttpTestBase.DEFAULT_HTTP_HOST, "/").onComplete(onSuccess(ws -> {
ws.pause();
ws.handler(buff -> {
fail("Should not receive a buffer");
});
ws.fetch(1);
ws.endHandler(v2 -> {
testComplete();
});
}));
}));
await();
}

@Test
public void testServerWebSocketPingExceeds125Bytes() {
Expand Down

0 comments on commit 967008a

Please sign in to comment.