diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-09-13 23:12:16 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-14 00:14:45 +0200 |
commit | d6cfa34667fe808975279c237d4ac9fe612631d8 (patch) | |
tree | 76a873fbbd1af254048bc4b1104c72cd589df34b /Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp | |
parent | 1c9c43785d0f3b810e581a6d3267e52f566733b4 (diff) | |
download | serenity-d6cfa34667fe808975279c237d4ac9fe612631d8.zip |
AK: Make URL::m_port an Optional<u16>, Expose raw port getter
Our current way of signalling a missing port with m_port == 0 was
lacking, as 0 is a valid port number in URLs.
Diffstat (limited to 'Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp')
-rw-r--r-- | Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp b/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp index db25972710..709f28fc7f 100644 --- a/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp +++ b/Userland/Libraries/LibWebSocket/Impl/TCPWebSocketConnectionImpl.cpp @@ -34,7 +34,7 @@ void TCPWebSocketConnectionImpl::connect(ConnectionInfo const& connection) m_socket->on_connected = [this] { on_connected(); }; - bool success = m_socket->connect(connection.url().host(), connection.url().port()); + bool success = m_socket->connect(connection.url().host(), connection.url().port_or_default()); if (!success) { deferred_invoke([this] { on_connection_error(); |