fix: cleanup
This commit is contained in:
parent
8679bfe680
commit
be84c0e4c2
9 changed files with 5 additions and 20 deletions
|
@ -9,8 +9,8 @@ helpers::get_server_port(int fd)
|
|||
return -1;
|
||||
}
|
||||
struct sockaddr_in sin{};
|
||||
socklen_t addrlen = sizeof(sin);
|
||||
if(getsockname(fd, (struct sockaddr *)&sin, &addrlen) == 0)
|
||||
socklen_t addr_len = sizeof(sin);
|
||||
if(getsockname(fd, (struct sockaddr *)&sin, &addr_len) == 0)
|
||||
{
|
||||
return ntohs(sin.sin_port);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ helpers::open_tcp_connection(char *host, char *port)
|
|||
|
||||
if ((status = getaddrinfo(host, port, &hints, &res)) != 0)
|
||||
{
|
||||
LOG_ERROR << "Error getting addressinfo: " << gai_strerror(status);
|
||||
LOG_ERROR << "Error getting address info: " << gai_strerror(status);
|
||||
freeaddrinfo(res);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <trantor/utils/Logger.h>
|
||||
#include "config.h"
|
||||
#include <helpers.h>
|
||||
#include <unistd.h>
|
||||
#include <helpers.h>
|
||||
|
||||
int
|
||||
helpers::send_udp_broadcast(const char *addr, uint16_t port, const char* message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue