summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-03-26 14:25:45 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-03-26 23:19:20 +0100
commit95cbcec8f986492766c4be3922af1e7644e1e7c5 (patch)
tree8ab1d4ad09d8bc078a96a18032be464c41e3bb1e /lib/transfer.c
parentd003b0213a08678264db5c987a0556a2a6785438 (diff)
downloadcurl-95cbcec8f986492766c4be3922af1e7644e1e7c5.tar.gz
urldata: merge "struct DynamicStatic" into "struct UrlState"
Both were used for the same purposes and there was no logical separation between them. Combined, this also saves 16 bytes in less holes in my test build. Closes #6798
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index ae414cfc5..1976bc033 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1392,20 +1392,20 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
{
CURLcode result;
- if(!data->change.url && !data->set.uh) {
+ if(!data->state.url && !data->set.uh) {
/* we can't do anything without URL */
failf(data, "No URL set!");
return CURLE_URL_MALFORMAT;
}
/* since the URL may have been redirected in a previous use of this handle */
- if(data->change.url_alloc) {
+ if(data->state.url_alloc) {
/* the already set URL is allocated, free it first! */
- Curl_safefree(data->change.url);
- data->change.url_alloc = FALSE;
+ Curl_safefree(data->state.url);
+ data->state.url_alloc = FALSE;
}
- if(!data->change.url && data->set.uh) {
+ if(!data->state.url && data->set.uh) {
CURLUcode uc;
free(data->set.str[STRING_SET_URL]);
uc = curl_url_get(data->set.uh,
@@ -1419,7 +1419,7 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
data->state.prefer_ascii = data->set.prefer_ascii;
data->state.list_only = data->set.list_only;
data->state.httpreq = data->set.method;
- data->change.url = data->set.str[STRING_SET_URL];
+ data->state.url = data->set.str[STRING_SET_URL];
/* Init the SSL session ID cache here. We do it here since we want to do it
after the *_setopt() calls (that could specify the size of the cache) but
@@ -1451,11 +1451,11 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
data->state.infilesize = 0;
/* If there is a list of cookie files to read, do it now! */
- if(data->change.cookielist)
+ if(data->state.cookielist)
Curl_cookie_loadfiles(data);
/* If there is a list of host pairs to deal with */
- if(data->change.resolve)
+ if(data->state.resolve)
result = Curl_loadhostpairs(data);
if(!result) {
@@ -1585,15 +1585,15 @@ CURLcode Curl_follow(struct Curl_easy *data,
when we get the next URL. We pick the ->url field, which may or may
not be 100% correct */
- if(data->change.referer_alloc) {
- Curl_safefree(data->change.referer);
- data->change.referer_alloc = FALSE;
+ if(data->state.referer_alloc) {
+ Curl_safefree(data->state.referer);
+ data->state.referer_alloc = FALSE;
}
- data->change.referer = strdup(data->change.url);
- if(!data->change.referer)
+ data->state.referer = strdup(data->state.url);
+ if(!data->state.referer)
return CURLE_OUT_OF_MEMORY;
- data->change.referer_alloc = TRUE; /* yes, free this later */
+ data->state.referer_alloc = TRUE; /* yes, free this later */
}
}
}
@@ -1641,13 +1641,13 @@ CURLcode Curl_follow(struct Curl_easy *data,
if(disallowport)
data->state.allow_port = FALSE;
- if(data->change.url_alloc)
- Curl_safefree(data->change.url);
+ if(data->state.url_alloc)
+ Curl_safefree(data->state.url);
- data->change.url = newurl;
- data->change.url_alloc = TRUE;
+ data->state.url = newurl;
+ data->state.url_alloc = TRUE;
- infof(data, "Issue another request to this URL: '%s'\n", data->change.url);
+ infof(data, "Issue another request to this URL: '%s'\n", data->state.url);
/*
* We get here when the HTTP code is 300-399 (and 401). We need to perform
@@ -1808,7 +1808,7 @@ CURLcode Curl_retry_request(struct Curl_easy *data, char **url)
}
infof(data, "Connection died, retrying a fresh connect\
(retry count: %d)\n", data->state.retrycount);
- *url = strdup(data->change.url);
+ *url = strdup(data->state.url);
if(!*url)
return CURLE_OUT_OF_MEMORY;