[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Utilize the message queue for SSH_REQUEST_GLOBAL.


Since this didn't get any reply, I'm wondering if you need additional information. I'm using this patch to avoid having to implement a special callback just for SSH_REQUEST_GLOBAL messages, while I can handle the other message types using the message queue and ssh_message_get().

Regards
Max


On 19.12.2016 11:10, Max Bachmann wrote:
Signed-off-by: Max Bachmann <mabahltm@xxxxxxxxx>
---
 src/messages.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/messages.c b/src/messages.c
index 2b139fb..9bbfc4c 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -1398,7 +1398,8 @@ SSH_PACKET_CALLBACK(ssh_packet_global_request){
                     msg->global_request.bind_port);
             session->common.callbacks->global_request_function(session, msg, session->common.callbacks->userdata);
         } else {
-            ssh_message_reply_default(msg);
+            ssh_message_queue(session, msg);
+            return rc;
         }
     } else if (strcmp(request, "cancel-tcpip-forward") == 0) {
         r = ssh_buffer_unpack(packet, "sd",
@@ -1417,7 +1418,8 @@ SSH_PACKET_CALLBACK(ssh_packet_global_request){
         if(ssh_callbacks_exists(session->common.callbacks, global_request_function)) {
             session->common.callbacks->global_request_function(session, msg, session->common.callbacks->userdata);
         } else {
-            ssh_message_reply_default(msg);
+            ssh_message_queue(session, msg);
+            return rc;
         }
     } else if(strcmp(request, "keepalive@xxxxxxxxxxx") == 0) {
         msg->global_request.type = SSH_GLOBAL_REQUEST_KEEPALIVE;


Archive administrator: postmaster@lists.cynapses.org