Make SessionHandle keep record if it is used with the multi interface or
authorDaniel Stenberg <daniel@haxx.se>
Mon, 5 Aug 2002 17:04:39 +0000 (17:04 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 5 Aug 2002 17:04:39 +0000 (17:04 +0000)
the easy interface, it CANNOT be used by a mixture.

lib/multi.c
lib/transfer.c
lib/urldata.h

index d6ede82358b00a1ca30a30eae1bad55eb7bd66be..2e6a408b4504e1de8a3f7355f04ea7a717171cea 100644 (file)
@@ -263,10 +263,13 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
     case CURLM_STATE_INIT:
       /* init this transfer. */
       easy->result=Curl_pretransfer(easy->easy_handle);
+
       if(CURLE_OK == easy->result) {
         /* after init, go CONNECT */
         easy->state = CURLM_STATE_CONNECT;
         result = CURLM_CALL_MULTI_PERFORM; 
+        
+        easy->easy_handle->state.used_interface = Curl_if_multi;
       }
       break;
     case CURLM_STATE_CONNECT:
index f266a4a3b8bbc9db735ef28fca085d27035e0ecb..ae9d621c830fc919cb32ef942d3549b6b3b7456b 100644 (file)
@@ -1156,6 +1156,8 @@ CURLcode Curl_perform(struct SessionHandle *data)
   struct connectdata *conn=NULL;
   char *newurl = NULL; /* possibly a new URL to follow to! */
 
+  data->state.used_interface = Curl_if_easy;
+
   res = Curl_pretransfer(data);
   if(res)
     return res;
index cb0e3dec9ffde465b1d04f448d614414afeaa944..57ac155298563a6640b1509caf3077a5f41de28b 100644 (file)
@@ -488,6 +488,12 @@ typedef enum {
 #define MAX_CURL_PASSWORD_LENGTH 256
 
 struct UrlState {
+  enum {
+    Curl_if_none,
+    Curl_if_easy,
+    Curl_if_multi
+  } used_interface;
+
   /* buffers to store authentication data in, as parsed from input options */
   char user[MAX_CURL_USER_LENGTH];
   char passwd[MAX_CURL_PASSWORD_LENGTH];