proxy: fix Windows warnings - getsockopt cast, uasync_add_socket_t
This commit is contained in:
1 parent
17202beb0a
commit
b9a31b9fba
3 files changed
+4
-4
No files matched your search
@@ -340,7 +340,7 @@ int icmp_proxy_init(struct UTUN_INSTANCE* inst, struct UASYNC* ua) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_SOCKET, "icmp_proxy: raw socket(SOCK_RAW) failed: %s", strerror(errno));
|
||||
else {
|
||||
DEBUG_INFO(DEBUG_CATEGORY_SOCKET, "icmp_proxy: raw socket created fd=%d", ctx->raw_sock);
|
||||
ctx->raw_read_id = uasync_add_socket(ua, ctx->raw_sock, raw_read_cb, NULL, NULL, NULL);
|
||||
ctx->raw_read_id = uasync_add_socket_t(ua, ctx->raw_sock, raw_read_cb, NULL, NULL, NULL);
|
||||
if (!ctx->raw_read_id) { socket_close_wrapper(ctx->raw_sock); ctx->raw_sock = SOCKET_INVALID; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,8 +187,8 @@ static void diag_timer_cb(void* arg) {
|
||||
|
||||
int rcv_buf = 0, snd_buf = 0;
|
||||
socklen_t optlen = sizeof(int);
|
||||
getsockopt(tc->sock, SOL_SOCKET, SO_RCVBUF, &rcv_buf, &optlen);
|
||||
getsockopt(tc->sock, SOL_SOCKET, SO_SNDBUF, &snd_buf, &optlen);
|
||||
getsockopt(tc->sock, SOL_SOCKET, SO_RCVBUF, (char*)&rcv_buf, &optlen);
|
||||
getsockopt(tc->sock, SOL_SOCKET, SO_SNDBUF, (char*)&snd_buf, &optlen);
|
||||
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_SOCKET,
|
||||
"SOCK:DIAG fd=%d sid=%08x conn=%d fin=%d "
|
||||
|
||||
@@ -95,7 +95,7 @@ static void exit_handle_data(struct ETCP_CONN* conn, struct ll_entry* entry) {
|
||||
socket_set_nonblocking(f->sock);
|
||||
struct sockaddr_in bind_addr = {.sin_family = AF_INET, .sin_addr = {.s_addr = INADDR_ANY}, .sin_port = 0};
|
||||
bind(f->sock, (struct sockaddr*)&bind_addr, sizeof(bind_addr));
|
||||
f->read_id = uasync_add_socket(g_udp_ctx->ua, f->sock, flow_read_cb, NULL, NULL, f);
|
||||
f->read_id = uasync_add_socket_t(g_udp_ctx->ua, f->sock, flow_read_cb, NULL, NULL, f);
|
||||
if (!f->read_id) { socket_close_wrapper(f->sock); u_free(f); goto drop; }
|
||||
f->next = g_udp_ctx->flows; g_udp_ctx->flows = f; g_udp_ctx->flow_count++;
|
||||
if (!g_udp_ctx->expire_timer)
|
||||
|
||||
Reference in new issue
Block a user