FS-11903: Fix errors (again) reported by PVS-Studio Static Code Analyzer for switch_apr.c
This commit is contained in:
parent
ae64513044
commit
185fe09912
|
@ -837,27 +837,23 @@ SWITCH_DECLARE(switch_status_t) switch_sockaddr_info_get(switch_sockaddr_t ** sa
|
||||||
SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on)
|
SWITCH_DECLARE(switch_status_t) switch_socket_opt_set(switch_socket_t *sock, int32_t opt, int32_t on)
|
||||||
{
|
{
|
||||||
if (opt == SWITCH_SO_TCP_KEEPIDLE) {
|
if (opt == SWITCH_SO_TCP_KEEPIDLE) {
|
||||||
int r = -10;
|
|
||||||
|
|
||||||
#if defined(TCP_KEEPIDLE)
|
#if defined(TCP_KEEPIDLE)
|
||||||
|
int r = -10;
|
||||||
r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPIDLE, (void *)&on, sizeof(on));
|
r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPIDLE, (void *)&on, sizeof(on));
|
||||||
|
return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||||
#else
|
#else
|
||||||
return SWITCH_STATUS_NOTIMPL;
|
return SWITCH_STATUS_NOTIMPL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt == SWITCH_SO_TCP_KEEPINTVL) {
|
if (opt == SWITCH_SO_TCP_KEEPINTVL) {
|
||||||
int r = -10;
|
|
||||||
|
|
||||||
#if defined(TCP_KEEPINTVL)
|
#if defined(TCP_KEEPINTVL)
|
||||||
|
int r = -10;
|
||||||
r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPINTVL, (void *)&on, sizeof(on));
|
r = setsockopt(sock->socketdes, SOL_TCP, TCP_KEEPINTVL, (void *)&on, sizeof(on));
|
||||||
|
return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||||
#else
|
#else
|
||||||
return SWITCH_STATUS_NOTIMPL;
|
return SWITCH_STATUS_NOTIMPL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return r ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return apr_socket_opt_set(sock, opt, on);
|
return apr_socket_opt_set(sock, opt, on);
|
||||||
|
|
Loading…
Reference in New Issue