summaryrefslogtreecommitdiff
path: root/src/socket
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-10-19 11:07:04 -0400
committerAndrew Opalach <andrew@akon.city> 2024-10-19 11:18:15 -0400
commitb8abe660fab174d37f8f49142f2261e93f463527 (patch)
tree407b1e7c9113ca2d628775bf7d6921e93df722d2 /src/socket
parent9e63fb59e7b8506183172869ea44b68cdec29be5 (diff)
downloadlibnaunet-b8abe660fab174d37f8f49142f2261e93f463527.tar.gz
libnaunet-b8abe660fab174d37f8f49142f2261e93f463527.tar.bz2
libnaunet-b8abe660fab174d37f8f49142f2261e93f463527.zip
Simplify packet_pool, various fixes
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/socket')
-rw-r--r--src/socket/socket.h4
-rw-r--r--src/socket/socket_linux.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/socket/socket.h b/src/socket/socket.h
index 18e3040..36b101a 100644
--- a/src/socket/socket.h
+++ b/src/socket/socket.h
@@ -59,8 +59,10 @@ bool aki_socket_init(struct aki_socket *sock);
void aki_socket_set_blocking(struct aki_socket *sock, bool blocking);
void aki_socket_set_nodelay(struct aki_socket *sock, s32 nodelay);
-void aki_socket_set_send_buf(struct aki_socket *sock, u32 sndbuf);
u32 aki_socket_get_send_buf(struct aki_socket *sock);
+void aki_socket_set_send_buf(struct aki_socket *sock, u32 sndbuf);
+u32 aki_socket_get_recv_buf(struct aki_socket *sock);
+void aki_socket_set_recv_buf(struct aki_socket *sock, u32 rcvbuf);
bool aki_socket_set(struct aki_socket *sock, str *addr, u16 port);
bool aki_socket_bind(struct aki_socket *sock, str *addr, u16 port);
diff --git a/src/socket/socket_linux.c b/src/socket/socket_linux.c
index 753f6b9..b89aac6 100644
--- a/src/socket/socket_linux.c
+++ b/src/socket/socket_linux.c
@@ -112,7 +112,7 @@ static bool parse_address(struct aki_socket *sock, str *addr, u16 port)
char *c_str = addr ? al_str_to_c_str(addr) : NULL;
if (!c_str) hints.ai_flags = AI_PASSIVE;
char port_str[6];
- al_sprintf(port_str, "%hu", port);
+ al_snprintf(port_str, sizeof(port_str), "%hu", port);
s32 status = getaddrinfo(c_str, port_str, &hints, &sock->addrinfo);
al_free(c_str);
if (status != 0) {