mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
websocket: fix segfaults for client-side connections
This commit is contained in:
parent
01b9ecec45
commit
216d4edfbf
1 changed files with 2 additions and 3 deletions
|
@ -95,11 +95,10 @@ struct websocket_connection {
|
|||
{
|
||||
if (c.wsi) {
|
||||
char name[128];
|
||||
char ip[128];
|
||||
|
||||
lws_get_peer_addresses(c.wsi, lws_get_socket_fd(c.wsi), name, sizeof(name), ip, sizeof(ip));
|
||||
lws_get_peer_simple(c.wsi, name, sizeof(name));
|
||||
|
||||
os << "remote.ip=" << ip << " remote.name=" << name;
|
||||
os << "remote=" << name;
|
||||
}
|
||||
else if (c.mode == websocket_connection::Mode::CLIENT && c.destination != nullptr)
|
||||
os << "dest=" << c.destination->info.address << ":" << c.destination->info.port;
|
||||
|
|
Loading…
Add table
Reference in a new issue