v1.7.5
This commit is contained in:
9
sock.h
9
sock.h
@@ -4,7 +4,7 @@
|
||||
# @@@@@@ #
|
||||
# @ @ #
|
||||
# @====@ #
|
||||
# @ @ sock.h - v1.7.4 #
|
||||
# @ @ sock.h - v1.7.5 #
|
||||
# @ @ MIT License #
|
||||
# @@% .@ @ #
|
||||
# @@ @ @ https://github.com/seajee/sock.h #
|
||||
@@ -375,6 +375,7 @@ SockAddrList sock_dns(const char *addr, int port, SockAddrType addr_hint, SockTy
|
||||
|
||||
struct addrinfo *res;
|
||||
if (getaddrinfo(addr, service, &hints, &res) != 0) {
|
||||
sock_addr_list_free(&list);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -514,7 +515,7 @@ bool sock_async_accept(Sock *sock, SockThreadCallback fn, void *user_data)
|
||||
|
||||
if (sock->type != SOCK_TCP) {
|
||||
sock->last_errno = EINVAL;
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
Sock *client = sock_accept(sock);
|
||||
@@ -555,7 +556,7 @@ bool sock_connect(Sock *sock, SockAddr addr)
|
||||
|
||||
if (sock->type != SOCK_TCP) {
|
||||
sock->last_errno = EINVAL;
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (connect(sock->fd, &addr.sockaddr, addr.len) < 0) {
|
||||
@@ -821,6 +822,8 @@ void sock__convert_addr(SockAddr *addr)
|
||||
/*
|
||||
Revision history:
|
||||
|
||||
1.7.5 (2025-12-13) Return false instead of NULL when returning a bool;
|
||||
Fixed memory leak in sock_dns()
|
||||
1.7.4 (2025-12-13) Ignore signals in send and sendto
|
||||
1.7.3 (2025-09-20) Changed sock_send_all() signature; drain buffers on
|
||||
sock_close() to prevent data loss
|
||||
|
||||
Reference in New Issue
Block a user