Skip to content

Commit

Permalink
use dynamic_cast instead of qobject_cast (#48122)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkarneges authored Feb 14, 2025
1 parent b7a5419 commit 76a1f77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/handler/handlerengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1776,13 +1776,13 @@ class HandlerEngine::Private : public QObject

if(f.type == PublishFormat::HttpResponse || f.type == PublishFormat::HttpStream)
{
HttpSession *hs = qobject_cast<HttpSession*>(target);
HttpSession *hs = dynamic_cast<HttpSession*>(target);

hs->publish(item, exposeHeaders);
}
else if(f.type == PublishFormat::WebSocketMessage)
{
WsSession *s = qobject_cast<WsSession*>(target);
WsSession *s = dynamic_cast<WsSession*>(target);

s->publish(item);
}
Expand Down
2 changes: 1 addition & 1 deletion src/proxy/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ class Engine::Private : public QObject
return;
}

WebSocketOverHttp *woh = qobject_cast<WebSocketOverHttp*>(ps->outSocket());
WebSocketOverHttp *woh = dynamic_cast<WebSocketOverHttp*>(ps->outSocket());
if(woh)
woh->refresh();

Expand Down
2 changes: 1 addition & 1 deletion src/proxy/wsproxysession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ private slots:

void wsControl_refreshEventReceived()
{
WebSocketOverHttp *woh = qobject_cast<WebSocketOverHttp*>(outSock);
WebSocketOverHttp *woh = dynamic_cast<WebSocketOverHttp*>(outSock);
if(woh)
woh->refresh();
}
Expand Down

0 comments on commit 76a1f77

Please sign in to comment.