1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

client: handle x11 channel open requests with callbacks

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Aris Adamantiadis
2013-04-02 22:00:06 +02:00
committed by Andreas Schneider
parent f457080d62
commit 3e7bd72f76
2 changed files with 30 additions and 1 deletions

View File

@@ -130,6 +130,19 @@ static int ssh_execute_server_callbacks(ssh_session session, ssh_message msg){
ssh_message_reply_default(msg);
}
return SSH_OK;
} else if (msg->channel_request_open.type == SSH_CHANNEL_X11){
if(ssh_callbacks_exists(session->common.callbacks, channel_open_request_x11_function)){
channel = session->common.callbacks->channel_open_request_x11_function (session,
msg->channel_request_open.originator, msg->channel_request_open.originator_port,
session->common.callbacks->userdata);
if(channel != NULL) {
rc = ssh_message_channel_request_open_reply_accept_channel(msg, channel);
return SSH_OK;
} else {
ssh_message_reply_default(msg);
}
return SSH_OK;
}
}
}
break;