Address code review feedback

- Avoid unnecessary SocketAddress object construction by calling family() directly
- Use specific exception type (Poco::Exception) instead of catch-all

Co-authored-by: aleks-f <2429093+aleks-f@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-08 01:58:26 +00:00
parent 47583fba30
commit 8a3b177c5c

View File

@@ -47,11 +47,10 @@ WebSocketImpl::WebSocketImpl(StreamSocketImpl* pStreamSocketImpl, HTTPSession& s
// for small WebSocket frames. Skip for Unix domain sockets.
try
{
SocketAddress addr = _pStreamSocketImpl->address();
if (addr.family() != SocketAddress::UNIX_LOCAL)
if (_pStreamSocketImpl->address().family() != SocketAddress::UNIX_LOCAL)
_pStreamSocketImpl->setNoDelay(true);
}
catch (...)
catch (Poco::Exception&)
{
// Ignore errors (e.g., if socket is not connected yet or doesn't support TCP options)
}