Merge pull request #18334 from Faless/coverity_net
Various coverity scan fixes, WS FreeBSD fixes
This commit is contained in:
commit
9834b690ae
6 changed files with 42 additions and 14 deletions
|
|
@ -335,7 +335,9 @@ Error StreamPeerTCPWinsock::connect_to_host(const IP_Address &p_host, uint16_t p
|
|||
void StreamPeerTCPWinsock::set_no_delay(bool p_enabled) {
|
||||
ERR_FAIL_COND(!is_connected_to_host());
|
||||
int flag = p_enabled ? 1 : 0;
|
||||
setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int));
|
||||
if (setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) != 0) {
|
||||
ERR_PRINT("Unable to set TCP no delay option");
|
||||
}
|
||||
}
|
||||
|
||||
int StreamPeerTCPWinsock::get_available_bytes() const {
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ Error TCPServerWinsock::listen(uint16_t p_port, const IP_Address &p_bind_address
|
|||
ERR_FAIL_V(FAILED);
|
||||
};
|
||||
} else {
|
||||
closesocket(sockfd);
|
||||
return ERR_ALREADY_IN_USE;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue