]> granicus.if.org Git - curl/commitdiff
7.7 alpha 2 commit curl-7_7_alpha2
authorDaniel Stenberg <daniel@haxx.se>
Sun, 4 Mar 2001 16:34:20 +0000 (16:34 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 4 Mar 2001 16:34:20 +0000 (16:34 +0000)
CHANGES
configure.in
docs/curl_easy_perform.3
docs/curl_slist_append.3
include/curl/curl.h
lib/url.c
src/version.h
tests/data/reply110001.txt

diff --git a/CHANGES b/CHANGES
index a94af051e1c2e8b2ae26d9324b2780e2f5e1bcc7..745c350f43b85d4deb254334afce3d63ce2f1d19 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,11 @@
 
 ** curl 7.7 DOES NOT currently WORK. **
 
+Daniel (4 March 2001)
+- Now, there's even a basic check that a re-used connection is still alive
+  before it is assumed so. A few first tests have proven that libcurl will
+  then re-connect instead of re-use the dead connection!
+
 Daniel (2 March 2001)
 - Now they work intermixed as well. Major coolness!
 
index 91409d17489371adb6f8f8cb3b7aec197b958a3a..5feb45ff79419b9ec4f19f45e53c88d4a1d6f0e5 100644 (file)
@@ -733,5 +733,6 @@ AC_OUTPUT( Makefile \
           packages/Linux/Makefile \
           packages/Linux/RPM/Makefile \
           packages/Linux/RPM/curl.spec \
-          packages/Linux/RPM/curl-ssl.spec )
+          packages/Linux/RPM/curl-ssl.spec \
+           tiny/Makefile )
 
index edf7875e9f2e9645cf011532140635fa167acfc3..f892fd3fee334450f53f243c273070ab25c71883 100644 (file)
@@ -2,7 +2,7 @@
 .\" nroff -man [file]
 .\" Written by daniel@haxx.se
 .\"
-.TH curl_easy_perform 3 "25 Jan 2001" "Curl 7.0" "libcurl Manual"
+.TH curl_easy_perform 3 "1 Mar 2001" "Curl 7.0" "libcurl Manual"
 .SH NAME
 curl_easy_perform - Do the actual transfer in a "easy" session
 .SH SYNOPSIS
@@ -25,7 +25,7 @@ again first.
 .I <curl/curl.h>
 defines. If the CURLOPT_ERRORBUFFER was set with
 .I curl_easy_setopt
-there willo be a readable error message in the error buffer when non-zero is
+there will be a readable error message in the error buffer when non-zero is
 returned.
 .SH "SEE ALSO"
 .BR curl_easy_init "(3), " curl_easy_setopt "(3), "
index 42dd27982d633ff0d9e8e9811ecca558b7339cc9..3780980db308c88234e225b6f098eeb569afd419 100644 (file)
@@ -2,14 +2,14 @@
 .\" nroff -man [file]
 .\" Written by daniel@haxx.se
 .\"
-.TH curl_slist_append 3 "2 June 2000" "Curl 7.0" "libcurl Manual"
+.TH curl_slist_append 3 "1 Mar 2001" "Curl 7.7" "libcurl Manual"
 .SH NAME
 curl_slist_append - add a string to an slist
 .SH SYNOPSIS
 .B #include <curl/curl.h>
 .sp
 .BI "struct curl_slist *curl_slist_append(struct curl_slit *" list,
-.BI "char * "string ");"
+.BI "const char * "string ");"
 .ad
 .SH DESCRIPTION
 curl_slist_append() appends a specified string to a linked list of
index d36e654d3378a33da95033bc240fc16264babeb4..b88ef35fb41c64e147ea53331fb5737f5f76d79e 100644 (file)
@@ -458,7 +458,7 @@ char *curl_getenv(char *variable);
 char *curl_version(void);
 
 /* This is the version number */
-#define LIBCURL_VERSION "7.7-alpha1"
+#define LIBCURL_VERSION "7.7-alpha2"
 #define LIBCURL_VERSION_NUM 0x070000
 
 /* linked-list structure for the CURLOPT_QUOTE option (and other) */
index 9318d4132b2a7868c80ee32b98e48b28cb863466..123e5d480ac10a5a3eaf8939c62eeae71bcb10d8 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -575,6 +575,32 @@ CURLcode curl_disconnect(CURLconnect *c_connect)
   return CURLE_OK;
 }
 
+/*
+ * This function should return TRUE if the socket is to be assumed to
+ * be dead. Most commonly this happens when the server has closed the
+ * connection due to inactivity.
+ */
+static bool SocketIsDead(int sock) 
+{ 
+  int sval; 
+  bool ret_val = TRUE; 
+  fd_set check_set; 
+  struct timeval to; 
+
+  FD_ZERO(&check_set); 
+  FD_SET(sock,&check_set); 
+
+  to.tv_sec = 0; 
+  to.tv_usec = 1; 
+
+  sval = select(sock + 1, &check_set, 0, 0, &to);
+  if(sval == 0) 
+    /* timeout */
+    ret_val = FALSE; 
+  
+  return ret_val;
+}
+
 /*
  * Given one filled in connection struct, this function should detect if there
  * already is one that have all the significant details exactly the same and
@@ -609,6 +635,16 @@ ConnectionExists(struct UrlData *data,
           continue;
         }
       }
+      {
+        bool dead;
+        dead = SocketIsDead(check->firstsocket);
+        if(dead) {
+          infof(data, "Connection %d seems to be dead!\n", i);
+          curl_disconnect(check); /* disconnect resources */
+          data->connects[i]=NULL; /* nothing here */
+          continue; /* try another one now */
+        }
+      }
       *usethis = check;
       return TRUE; /* yes, we found one to use! */
     }
@@ -909,7 +945,6 @@ static CURLcode ConnectPlease(struct UrlData *data,
   return CURLE_OK;
 }
 
-
 static CURLcode _connect(CURL *curl,
                          CURLconnect **in_connect,
                          bool allow_port) /* allow data->use_port ? */
index a5860e6ea431a4e9de0fb80d4789d13ad1663f3d..71710ab13a91a361eb584fa166411408a00251bc 100644 (file)
@@ -1,3 +1,3 @@
 #define CURL_NAME "curl"
-#define CURL_VERSION "7.7-alpha1"
+#define CURL_VERSION "7.7-alpha2"
 #define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") "
index 18caf57c45422a66d8639838aa28c0f0246cc3e9..79bd0450334493ef3fb244b3eb995ab19450b899 100644 (file)
@@ -2,6 +2,7 @@ HTTP/1.1 301 This is a weirdo text message
 Date: Thu, 09 Nov 2010 14:49:00 GMT
 Server: test-server/fake
 Location: data/110002.txt?coolsite=yes
+Connection: close
 
 HTTP/1.1 200 Followed here fine
 Date: Thu, 09 Nov 2010 14:49:00 GMT