mirror of
https://github.com/curl/curl.git
synced 2025-09-13 15:42:39 +03:00
Make SessionHandle keep record if it is used with the multi interface or
the easy interface, it CANNOT be used by a mixture.
This commit is contained in:
parent
b98308b524
commit
108cb14d1f
|
@ -263,10 +263,13 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
|
||||||
case CURLM_STATE_INIT:
|
case CURLM_STATE_INIT:
|
||||||
/* init this transfer. */
|
/* init this transfer. */
|
||||||
easy->result=Curl_pretransfer(easy->easy_handle);
|
easy->result=Curl_pretransfer(easy->easy_handle);
|
||||||
|
|
||||||
if(CURLE_OK == easy->result) {
|
if(CURLE_OK == easy->result) {
|
||||||
/* after init, go CONNECT */
|
/* after init, go CONNECT */
|
||||||
easy->state = CURLM_STATE_CONNECT;
|
easy->state = CURLM_STATE_CONNECT;
|
||||||
result = CURLM_CALL_MULTI_PERFORM;
|
result = CURLM_CALL_MULTI_PERFORM;
|
||||||
|
|
||||||
|
easy->easy_handle->state.used_interface = Curl_if_multi;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CURLM_STATE_CONNECT:
|
case CURLM_STATE_CONNECT:
|
||||||
|
|
|
@ -1156,6 +1156,8 @@ CURLcode Curl_perform(struct SessionHandle *data)
|
||||||
struct connectdata *conn=NULL;
|
struct connectdata *conn=NULL;
|
||||||
char *newurl = NULL; /* possibly a new URL to follow to! */
|
char *newurl = NULL; /* possibly a new URL to follow to! */
|
||||||
|
|
||||||
|
data->state.used_interface = Curl_if_easy;
|
||||||
|
|
||||||
res = Curl_pretransfer(data);
|
res = Curl_pretransfer(data);
|
||||||
if(res)
|
if(res)
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -488,6 +488,12 @@ typedef enum {
|
||||||
#define MAX_CURL_PASSWORD_LENGTH 256
|
#define MAX_CURL_PASSWORD_LENGTH 256
|
||||||
|
|
||||||
struct UrlState {
|
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 */
|
/* buffers to store authentication data in, as parsed from input options */
|
||||||
char user[MAX_CURL_USER_LENGTH];
|
char user[MAX_CURL_USER_LENGTH];
|
||||||
char passwd[MAX_CURL_PASSWORD_LENGTH];
|
char passwd[MAX_CURL_PASSWORD_LENGTH];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user