Skip to content

Commit

Permalink
Allow building without rtti (#487)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arenevier authored Oct 14, 2023
1 parent 872f516 commit f29906c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ixwebsocket/IXWebSocketProxyServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace ix
server.setOnConnectionCallback(
[remoteUrl, remoteUrlsMapping](std::weak_ptr<ix::WebSocket> webSocket,
std::shared_ptr<ConnectionState> connectionState) {
auto state = std::dynamic_pointer_cast<ProxyConnectionState>(connectionState);
auto state = std::static_pointer_cast<ProxyConnectionState>(connectionState);
auto remoteIp = connectionState->getRemoteIp();

// Server connection
Expand Down

0 comments on commit f29906c

Please sign in to comment.