Displaying 2 results from an estimated 2 matches for "timeout_sigh".
2001 Nov 17
0
[PATCH] Connect timeout
...penssh-3.0.1p1/sshconnect.c Sat Nov 17 23:02:27 2001
@@ -35,6 +35,8 @@
char *client_version_string = NULL;
char *server_version_string = NULL;
+static jmp_buf jmpenv;
+
extern Options options;
extern char *__progname;
@@ -221,6 +223,43 @@
return sock;
}
+/* for alarm() */
+static void
+timeout_sigh(int dummy)
+{
+ errno = ETIMEDOUT;
+ longjmp(jmpenv, !0);
+}
+
+int
+timeout_connect(int sockfd, const struct sockaddr *serv_addr,
+ socklen_t addrlen, int timeout)
+{
+ void (*sigh)(int);
+ int rc;
+
+ if (timeout <= 0)
+ return(connect(sockfd, serv_addr, addrlen));
+
+ if (setjmp(jmpenv) =...
2002 Jan 26
5
[PATCH] Connect timeout
...07:45 2001
+++ sshconnect.c Sat Jan 26 21:44:35 2002
@@ -35,6 +35,8 @@
char *client_version_string = NULL;
char *server_version_string = NULL;
+static jmp_buf jmpenv;
+
extern Options options;
extern char *__progname;
@@ -221,6 +223,43 @@
return sock;
}
+/* for alarm() */
+static void
+timeout_sigh(int dummy)
+{
+ errno = ETIMEDOUT;
+ longjmp(jmpenv, !0);
+}
+
+int
+timeout_connect(int sockfd, const struct sockaddr *serv_addr,
+ socklen_t addrlen, int timeout)
+{
+ void (*sigh)(int);
+ int rc;
+
+ if (timeout <= 0)
+ return(connect(sockfd, serv_addr, addrlen));
+
+ if (setjmp(jmpenv) =...