mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
parent
0fe17c3e34
commit
01ed485cf3
4 changed files with 6 additions and 2 deletions
|
@ -71,6 +71,7 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst
|
|||
if(stfd == NULL){
|
||||
ret = ERROR_ST_OPEN_SOCKET;
|
||||
srs_error("st_netfd_open_socket failed. ret=%d", ret);
|
||||
::close(sock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -94,12 +95,14 @@ int srs_socket_connect(string server, int port, int64_t timeout, st_netfd_t* pst
|
|||
srs_info("connect ok. server=%s, ip=%s, port=%d", server.c_str(), ip.c_str(), port);
|
||||
|
||||
*pstfd = stfd;
|
||||
::close(sock);
|
||||
return ret;
|
||||
|
||||
failed:
|
||||
if (stfd) {
|
||||
srs_close_stfd(stfd);
|
||||
}
|
||||
::close(sock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue