Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,14 @@ void slowSessionCreationDoesNotBlockExistingSessionMutation()
CountDownLatch cancelReceived = new CountDownLatch(1);
server.createContext("/session/session-1/cancel", exchange -> {
cancelReceived.countDown();
exchange.getResponseHeaders().set("Connection", "close");
exchange.sendResponseHeaders(204, -1);
exchange.close();
});
server.createContext("/session/session-1/detach", noContent());
server.createContext("/session/session-2/detach", noContent());
server.createContext("/session/session-1/detach",
noContentAndCloseConnection());
server.createContext("/session/session-2/detach",
noContentAndCloseConnection());

try (DaemonClient daemon = newClient();
DaemonSessionClient first = daemon.createSession()) {
Expand Down Expand Up @@ -2949,6 +2952,14 @@ private static HttpHandler noContent() {
};
}

private static HttpHandler noContentAndCloseConnection() {
return exchange -> {
exchange.getResponseHeaders().set("Connection", "close");
exchange.sendResponseHeaders(204, -1);
exchange.close();
};
}

private static void sendJson(HttpExchange exchange, int status, String body)
throws IOException {
byte[] bytes = body.getBytes(StandardCharsets.UTF_8);
Expand Down
Loading