diff --git a/repos/libports/ports/libssh.hash b/repos/libports/ports/libssh.hash index ad58f5df28..00988c5be4 100644 --- a/repos/libports/ports/libssh.hash +++ b/repos/libports/ports/libssh.hash @@ -1 +1 @@ -4a4abe3dbedf573e4889a6b2fa4d83c73cd8fd4c +a475cccf96aa9126ed5fd135f108996c02f448e8 diff --git a/repos/libports/ports/libssh.port b/repos/libports/ports/libssh.port index 4d35a0db40..a8fdaf56f7 100644 --- a/repos/libports/ports/libssh.port +++ b/repos/libports/ports/libssh.port @@ -8,3 +8,6 @@ DIR(libssh) := src/lib/libssh DIRS := include DIR_CONTENT(include) := src/lib/libssh/include/libssh + +PATCHES := src/lib/libssh/event_bind.patch +PATCH_OPT := -p1 -d src/lib/libssh diff --git a/repos/libports/src/lib/libssh/event_bind.patch b/repos/libports/src/lib/libssh/event_bind.patch new file mode 100644 index 0000000000..3c53727d0f --- /dev/null +++ b/repos/libports/src/lib/libssh/event_bind.patch @@ -0,0 +1,53 @@ +--- a/include/libssh/server.h ++++ b/include/libssh/server.h +@@ -176,6 +176,26 @@ + LIBSSH_API int ssh_bind_accept_fd(ssh_bind ssh_bind_o, ssh_session session, + socket_t fd); + ++/** ++ * @brief Register for non-blocking accepts of incoming ssh connections ++ * ++ * @param ssh_bind_o The ssh server bind to accept a connection. ++ * @param event A non-blocking event mainloop ++ * @see ssh_bind_accept ++ * @return SSH_OK when successfully registered ++ */ ++LIBSSH_API int ssh_event_add_bind(ssh_event event, ssh_bind ssh_bind_o); ++ ++/** ++ * @brief Remove bind from the event ++ * ++ * @param ssh_bind_o The ssh server bind to accept a connection. ++ * @param event A non-blocking event mainloop ++ * @see ssh_bind_accept ++ * @return SSH_OK when successfully registered ++ */ ++LIBSSH_API int ssh_event_remove_bind(ssh_event event, ssh_bind ssh_bind_o); ++ + LIBSSH_API ssh_gssapi_creds ssh_gssapi_get_creds(ssh_session session); + + /** +--- a/src/bind.c ++++ b/src/bind.c +@@ -532,6 +532,21 @@ + return rc; + } + ++int ssh_event_add_bind(ssh_event event, ssh_bind sshbind) { ++ ssh_poll_handle h = ssh_bind_get_poll(sshbind); ++ if (h == NULL) ++ return SSH_ERROR; ++ return ssh_event_add_poll(event, h); ++} ++ ++int ssh_event_remove_bind(ssh_event event, ssh_bind sshbind) { ++ ssh_poll_handle h = ssh_bind_get_poll(sshbind); ++ if (h == NULL) ++ return SSH_ERROR; ++ ssh_event_remove_poll(event, h); ++ return SSH_OK; ++} ++ + + /** + * @}