mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 02:38:09 +09:00
Fix proxy_disconnect on systems without pthread
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit b804aa9286)
This commit is contained in:
12
src/client.c
12
src/client.c
@@ -47,6 +47,12 @@
|
|||||||
#include "libssh/pki.h"
|
#include "libssh/pki.h"
|
||||||
#include "libssh/kex.h"
|
#include "libssh/kex.h"
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#ifdef HAVE_PTHREAD
|
||||||
|
extern int proxy_disconnect;
|
||||||
|
#endif /* HAVE_PTHREAD */
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#define set_status(session, status) do {\
|
#define set_status(session, status) do {\
|
||||||
if (session->common.callbacks && session->common.callbacks->connect_status_function) \
|
if (session->common.callbacks && session->common.callbacks->connect_status_function) \
|
||||||
session->common.callbacks->connect_status_function(session->common.callbacks->userdata, status); \
|
session->common.callbacks->connect_status_function(session->common.callbacks->userdata, status); \
|
||||||
@@ -765,8 +771,6 @@ ssh_session_set_disconnect_message(ssh_session session, const char *message)
|
|||||||
return SSH_OK;
|
return SSH_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int proxy_disconnect;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Disconnect from a session (client or server).
|
* @brief Disconnect from a session (client or server).
|
||||||
*
|
*
|
||||||
@@ -789,12 +793,14 @@ ssh_disconnect(ssh_session session)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#ifdef HAVE_PTHREAD
|
||||||
/* Only send the disconnect to all other threads when the root session calls
|
/* Only send the disconnect to all other threads when the root session calls
|
||||||
* ssh_disconnect() */
|
* ssh_disconnect() */
|
||||||
if (session->proxy_root) {
|
if (session->proxy_root) {
|
||||||
proxy_disconnect = 1;
|
proxy_disconnect = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* HAVE_PTHREAD */
|
||||||
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
if (session->disconnect_message == NULL) {
|
if (session->disconnect_message == NULL) {
|
||||||
session->disconnect_message = strdup("Bye Bye") ;
|
session->disconnect_message = strdup("Bye Bye") ;
|
||||||
|
|||||||
Reference in New Issue
Block a user