From f29906c72f1739e0c373495cde068923a88c2cc2 Mon Sep 17 00:00:00 2001 From: arenevier Date: Fri, 13 Oct 2023 19:56:24 -0700 Subject: [PATCH] Allow building without rtti (#487) Since factory returns a ProxyConnectionState, setOnConnectionCallback will be a ProxyConnectionState. The code already makes that assumption, since it does not check of state return value. Using a static_pointer_cast will allow the library to be build with rtti. --- ixwebsocket/IXWebSocketProxyServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ixwebsocket/IXWebSocketProxyServer.cpp b/ixwebsocket/IXWebSocketProxyServer.cpp index 4b78c63b..4df5a115 100644 --- a/ixwebsocket/IXWebSocketProxyServer.cpp +++ b/ixwebsocket/IXWebSocketProxyServer.cpp @@ -57,7 +57,7 @@ namespace ix server.setOnConnectionCallback( [remoteUrl, remoteUrlsMapping](std::weak_ptr webSocket, std::shared_ptr connectionState) { - auto state = std::dynamic_pointer_cast(connectionState); + auto state = std::static_pointer_cast(connectionState); auto remoteIp = connectionState->getRemoteIp(); // Server connection