Skip to content

Commit

Permalink
KTOR-6963 Fix darwin maxFrameSize option (#4374)
Browse files Browse the repository at this point in the history
* KTOR-6963 Fix darwin maxFrameSize option

* Update ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSockets.kt
  • Loading branch information
e5l authored Oct 9, 2024
1 parent 1c98f87 commit 89a3bbc
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ public class WebSockets internal constructor(
}

LOGGER.trace("Receive websocket session from ${context.request.url}: $session")

if (plugin.maxFrameSize != Int.MAX_VALUE.toLong()) {
session.maxFrameSize = plugin.maxFrameSize
}

val clientSession: ClientWebSocketSession = when (info.type) {
DefaultClientWebSocketSession::class -> {
val defaultSession = plugin.convertSessionToDefault(session)
Expand All @@ -201,7 +206,9 @@ public class WebSockets internal constructor(
}
}

else -> DelegatingClientWebSocketSession(context, session)
else -> {
DelegatingClientWebSocketSession(context, session)
}
}

proceedWith(HttpResponseContainer(info, clientSession))
Expand Down

0 comments on commit 89a3bbc

Please sign in to comment.