You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by "jmuehlner (via GitHub)" <gi...@apache.org> on 2024/05/24 18:28:05 UTC

Re: [PR] GUACAMOLE-600: Add support for setting SSH and SFTP timeouts. [guacamole-server]

jmuehlner commented on code in PR #414:
URL: https://github.com/apache/guacamole-server/pull/414#discussion_r1613864540


##########
src/common-ssh/ssh.c:
##########
@@ -453,17 +455,43 @@ guac_common_ssh_session* guac_common_ssh_create_session(guac_client* client,
             return NULL;
         }
 
-        /* Connect */
-        if (connect(fd, current_address->ai_addr,
-                        current_address->ai_addrlen) == 0) {
+        /* Set socket to non-blocking */
+        fcntl(fd, F_SETFL, O_NONBLOCK);
+        
+        /* Set up timeout. */
+        fd_set fdset;
+        FD_ZERO(&fdset);
+        FD_SET(fd, &fdset);
+
+        struct timeval tv;
+        tv.tv_sec = timeout;             /* 10 second timeout */

Review Comment:
   "10 second timeout"?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org