aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-10-26 21:57:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-10-26 21:57:12 +0000
commit9d0d8280e984ca265bb61f075020d85e9a5b9ad8 (patch)
tree800dcfab38901e652e4bd895436de2a59f342c1b /lib
parentcdfb83e0e35e71d7b7d31ed656d3101e12950e5f (diff)
Georg Horn provided a fix for the timeout signal stuff. Finally the timeout
switch should work under most unixes (requires sigaction())
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/url.c b/lib/url.c
index 32faa3423..c941e99e3 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -686,6 +686,9 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
char resumerange[12]="";
struct UrlData *data = curl;
struct connectdata *conn;
+#ifdef HAVE_SIGACTION
+ struct sigaction sigact;
+#endif
if(!data || (data->handle != STRUCT_OPEN))
return CURLE_BAD_FUNCTION_ARGUMENT; /* TBD: make error codes */
@@ -711,8 +714,11 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
buf = data->buffer; /* this is our buffer */
-#if 0
- signal(SIGALRM, alarmfunc);
+#ifdef HAVE_SIGACTION
+ sigaction(SIGALRM, NULL, &sigact);
+ sigact.sa_handler = alarmfunc;
+ sigact.sa_flags &= ~SA_RESTART;
+ sigaction(SIGALRM, &sigact, NULL);
#endif
/* Parse <url> */
@@ -1393,11 +1399,9 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)
failf(data, "Attempt to connect to broadcast address without socket broadcast flag or local firewall rule violated: %d",errno);
break;
#endif
-#ifdef EINTR
case EINTR:
failf(data, "Connection timeouted");
break;
-#endif
#if 0
case EAFNOSUPPORT:
failf(data, "Incorrect address family: %d",errno);