mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
server: use app-provided bind socket when available
This commit is contained in:
@@ -208,7 +208,7 @@ int ssh_bind_listen(ssh_bind sshbind) {
|
|||||||
if (host == NULL) {
|
if (host == NULL) {
|
||||||
host = "0.0.0.0";
|
host = "0.0.0.0";
|
||||||
}
|
}
|
||||||
|
if (sshbind->bindfd != SSH_INVALID_SOCKET){
|
||||||
fd = bind_socket(sshbind, host, sshbind->bindport);
|
fd = bind_socket(sshbind, host, sshbind->bindport);
|
||||||
if (fd == SSH_INVALID_SOCKET) {
|
if (fd == SSH_INVALID_SOCKET) {
|
||||||
ssh_key_free(sshbind->dsa);
|
ssh_key_free(sshbind->dsa);
|
||||||
@@ -226,7 +226,9 @@ int ssh_bind_listen(ssh_bind sshbind) {
|
|||||||
ssh_key_free(sshbind->rsa);
|
ssh_key_free(sshbind->rsa);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
SSH_LOG(sshbind, SSH_LOG_INFO, "Using app-provided bind socket");
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user