Skip to content

Commit

Permalink
Unreviewed Windows build fix after 276224@main
Browse files Browse the repository at this point in the history
* Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp:
(WebKit::WebSocketTask::didReceiveData):

Canonical link: https://commits.webkit.org/276227@main
  • Loading branch information
cdumez committed Mar 16, 2024
1 parent 4c53942 commit 937f323
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/WebKit/NetworkProcess/curl/WebSocketTaskCurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void WebSocketTask::didReceiveData(WebCore::CurlStreamID, const WebCore::SharedB
switch (opCode) {
case WebCore::WebSocketFrame::OpCodeText:
{
String message = length ? String::fromUTF8(data) : emptyString();
String message = data.size() ? String::fromUTF8(data) : emptyString();
if (!message.isNull())
m_channel.didReceiveText(message);
else
Expand All @@ -188,9 +188,9 @@ void WebSocketTask::didReceiveData(WebCore::CurlStreamID, const WebCore::SharedB
break;

case WebCore::WebSocketFrame::OpCodeClose:
if (!length)
if (!data.size())
m_closeEventCode = WebCore::ThreadableWebSocketChannel::CloseEventCode::CloseEventCodeNoStatusRcvd;
else if (length == 1) {
else if (data.size() == 1) {
m_closeEventCode = WebCore::ThreadableWebSocketChannel::CloseEventCode::CloseEventCodeAbnormalClosure;
didFail("Received a broken close frame containing an invalid size body."_s);
return;
Expand Down

0 comments on commit 937f323

Please sign in to comment.