mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
Fix channel_accept_x11 on Windows.
This commit is contained in:
@@ -1335,9 +1335,14 @@ error:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ssh_channel channel_accept(ssh_session session, int channeltype,
|
||||||
|
int timeout_ms) {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
static ssh_channel channel_accept(ssh_session session, int channeltype, int timeout_ms) {
|
static const struct timespec ts = {
|
||||||
static const struct timespec ts = {0, 50000000}; /* 50ms */
|
.tv_sec = 0,
|
||||||
|
.tv_nsec = 50000000 /* 50ms */
|
||||||
|
};
|
||||||
|
#endif
|
||||||
SSH_MESSAGE *msg = NULL;
|
SSH_MESSAGE *msg = NULL;
|
||||||
struct ssh_iterator *iterator;
|
struct ssh_iterator *iterator;
|
||||||
int t;
|
int t;
|
||||||
@@ -1358,7 +1363,11 @@ static ssh_channel channel_accept(ssh_session session, int channeltype, int time
|
|||||||
iterator = iterator->next;
|
iterator = iterator->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
Sleep(50); /* 50ms */
|
||||||
|
#else
|
||||||
nanosleep(&ts, NULL);
|
nanosleep(&ts, NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1376,7 +1385,6 @@ static ssh_channel channel_accept(ssh_session session, int channeltype, int time
|
|||||||
ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms) {
|
ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms) {
|
||||||
return channel_accept(channel->session, SSH_CHANNEL_X11, timeout_ms);
|
return channel_accept(channel->session, SSH_CHANNEL_X11, timeout_ms);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int global_request(ssh_session session, const char *request,
|
static int global_request(ssh_session session, const char *request,
|
||||||
ssh_buffer buffer, int reply) {
|
ssh_buffer buffer, int reply) {
|
||||||
|
|||||||
Reference in New Issue
Block a user