Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/AsyncWebSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ void AsyncWebSocketClient::binary(AsyncWebSocketMessageBuffer * buffer)

IPAddress AsyncWebSocketClient::remoteIP() {
if(!_client) {
return IPAddress(0U);
return IPAddress((uint32_t) 0);
Copy link

@agners agners Jul 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a type cast I'd just use a more specific type suffix:

Suggested change
return IPAddress((uint32_t) 0);
return IPAddress(0UL);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, using 0UL breaks ESP32. I think the only proper way to fix this is using a static type cast.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we return IPADDR_ANY or IPADDR_NONE here? IPADDR_ANY looks good for this, no?

}
return _client->remoteIP();
}
Expand Down