Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

7.7 alpha 2 commit

  • Loading branch information...
commit cf8704ccdf60a34ba7862a0848724b9862158c86 1 parent 5543c2f
Daniel Stenberg authored
5  CHANGES
@@ -8,6 +8,11 @@
8 8
 
9 9
 ** curl 7.7 DOES NOT currently WORK. **
10 10
 
  11
+Daniel (4 March 2001)
  12
+- Now, there's even a basic check that a re-used connection is still alive
  13
+  before it is assumed so. A few first tests have proven that libcurl will
  14
+  then re-connect instead of re-use the dead connection!
  15
+
11 16
 Daniel (2 March 2001)
12 17
 - Now they work intermixed as well. Major coolness!
13 18
 
3  configure.in
@@ -733,5 +733,6 @@ AC_OUTPUT( Makefile \
733 733
 	   packages/Linux/Makefile \
734 734
 	   packages/Linux/RPM/Makefile \
735 735
 	   packages/Linux/RPM/curl.spec \
736  
-	   packages/Linux/RPM/curl-ssl.spec )
  736
+	   packages/Linux/RPM/curl-ssl.spec \
  737
+           tiny/Makefile )
737 738
 
4  docs/curl_easy_perform.3
@@ -2,7 +2,7 @@
2 2
 .\" nroff -man [file]
3 3
 .\" Written by daniel@haxx.se
4 4
 .\"
5  
-.TH curl_easy_perform 3 "25 Jan 2001" "Curl 7.0" "libcurl Manual"
  5
+.TH curl_easy_perform 3 "1 Mar 2001" "Curl 7.0" "libcurl Manual"
6 6
 .SH NAME
7 7
 curl_easy_perform - Do the actual transfer in a "easy" session
8 8
 .SH SYNOPSIS
@@ -25,7 +25,7 @@ again first.
25 25
 .I <curl/curl.h>
26 26
 defines. If the CURLOPT_ERRORBUFFER was set with
27 27
 .I curl_easy_setopt
28  
-there willo be a readable error message in the error buffer when non-zero is
  28
+there will be a readable error message in the error buffer when non-zero is
29 29
 returned.
30 30
 .SH "SEE ALSO"
31 31
 .BR curl_easy_init "(3), " curl_easy_setopt "(3), "
4  docs/curl_slist_append.3
@@ -2,14 +2,14 @@
2 2
 .\" nroff -man [file]
3 3
 .\" Written by daniel@haxx.se
4 4
 .\"
5  
-.TH curl_slist_append 3 "2 June 2000" "Curl 7.0" "libcurl Manual"
  5
+.TH curl_slist_append 3 "1 Mar 2001" "Curl 7.7" "libcurl Manual"
6 6
 .SH NAME
7 7
 curl_slist_append - add a string to an slist
8 8
 .SH SYNOPSIS
9 9
 .B #include <curl/curl.h>
10 10
 .sp
11 11
 .BI "struct curl_slist *curl_slist_append(struct curl_slit *" list,
12  
-.BI "char * "string ");"
  12
+.BI "const char * "string ");"
13 13
 .ad
14 14
 .SH DESCRIPTION
15 15
 curl_slist_append() appends a specified string to a linked list of
2  include/curl/curl.h
@@ -458,7 +458,7 @@ char *curl_getenv(char *variable);
458 458
 char *curl_version(void);
459 459
 
460 460
 /* This is the version number */
461  
-#define LIBCURL_VERSION "7.7-alpha1"
  461
+#define LIBCURL_VERSION "7.7-alpha2"
462 462
 #define LIBCURL_VERSION_NUM 0x070000
463 463
 
464 464
 /* linked-list structure for the CURLOPT_QUOTE option (and other) */
37  lib/url.c
@@ -576,6 +576,32 @@ CURLcode curl_disconnect(CURLconnect *c_connect)
576 576
 }
577 577
 
578 578
 /*
  579
+ * This function should return TRUE if the socket is to be assumed to
  580
+ * be dead. Most commonly this happens when the server has closed the
  581
+ * connection due to inactivity.
  582
+ */
  583
+static bool SocketIsDead(int sock) 
  584
+{ 
  585
+  int sval; 
  586
+  bool ret_val = TRUE; 
  587
+  fd_set check_set; 
  588
+  struct timeval to; 
  589
+
  590
+  FD_ZERO(&check_set); 
  591
+  FD_SET(sock,&check_set); 
  592
+
  593
+  to.tv_sec = 0; 
  594
+  to.tv_usec = 1; 
  595
+
  596
+  sval = select(sock + 1, &check_set, 0, 0, &to);
  597
+  if(sval == 0) 
  598
+    /* timeout */
  599
+    ret_val = FALSE; 
  600
+  
  601
+  return ret_val;
  602
+}
  603
+
  604
+/*
579 605
  * Given one filled in connection struct, this function should detect if there
580 606
  * already is one that have all the significant details exactly the same and
581 607
  * thus should be used instead.
@@ -609,6 +635,16 @@ ConnectionExists(struct UrlData *data,
609 635
           continue;
610 636
         }
611 637
       }
  638
+      {
  639
+        bool dead;
  640
+        dead = SocketIsDead(check->firstsocket);
  641
+        if(dead) {
  642
+          infof(data, "Connection %d seems to be dead!\n", i);
  643
+          curl_disconnect(check); /* disconnect resources */
  644
+          data->connects[i]=NULL; /* nothing here */
  645
+          continue; /* try another one now */
  646
+        }
  647
+      }
612 648
       *usethis = check;
613 649
       return TRUE; /* yes, we found one to use! */
614 650
     }
@@ -909,7 +945,6 @@ static CURLcode ConnectPlease(struct UrlData *data,
909 945
   return CURLE_OK;
910 946
 }
911 947
 
912  
-
913 948
 static CURLcode _connect(CURL *curl,
914 949
                          CURLconnect **in_connect,
915 950
                          bool allow_port) /* allow data->use_port ? */
2  src/version.h
... ...
@@ -1,3 +1,3 @@
1 1
 #define CURL_NAME "curl"
2  
-#define CURL_VERSION "7.7-alpha1"
  2
+#define CURL_VERSION "7.7-alpha2"
3 3
 #define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") "
1  tests/data/reply110001.txt
@@ -2,6 +2,7 @@ HTTP/1.1 301 This is a weirdo text message
2 2
 Date: Thu, 09 Nov 2010 14:49:00 GMT
3 3
 Server: test-server/fake
4 4
 Location: data/110002.txt?coolsite=yes
  5
+Connection: close
5 6
 
6 7
 HTTP/1.1 200 Followed here fine
7 8
 Date: Thu, 09 Nov 2010 14:49:00 GMT

0 notes on commit cf8704c

Please sign in to comment.
Something went wrong with that request. Please try again.