mirror of
https://github.com/wangyu-/UDPspeeder.git
synced 2025-01-18 22:09:35 +08:00
Small condition merge
This commit is contained in:
parent
939b347129
commit
c6b0c3e5bc
@ -978,13 +978,11 @@ int new_connected_socket2(int &fd,address_t &addr,bool bind_enabled,address_t &b
|
||||
myexit(1);
|
||||
}
|
||||
|
||||
if (strlen(interface_string) > 0) {
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, interface_string, strlen(interface_string)) < 0) {
|
||||
if (strlen(interface_string) > 0 && setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, interface_string, strlen(interface_string)) < 0) {
|
||||
mylog(log_fatal,"socket interface bind error\n");
|
||||
//perror("socket bind error");
|
||||
myexit(1);
|
||||
}
|
||||
}
|
||||
|
||||
setnonblocking(fd);
|
||||
set_buf_size(fd, socket_buf_size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user