summaryrefslogtreecommitdiff
path: root/lib/urldata.h
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 14:40:11 +0100
commitbe3e74d226e7dd392ab16296cd9fc149cdd431c9 (patch)
tree3f4876cad711dffc724e0408e74a12a24a281614 /lib/urldata.h
parenteef3b43ae88647689bf68585081f30994563f75d (diff)
downloadcurl-bagder/urlstate-unify.tar.gz
urldata: merge "struct DynamicStatic" into "struct UrlState"bagder/urlstate-unify
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.
Diffstat (limited to 'lib/urldata.h')
-rw-r--r--lib/urldata.h34
1 files changed, 10 insertions, 24 deletions
diff --git a/lib/urldata.h b/lib/urldata.h
index fb37905a7..fec875652 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1321,8 +1321,6 @@ struct urlpieces {
struct UrlState {
/* Points to the connection cache */
struct conncache *conn_cache;
- int retrycount; /* number of retries on a new connection */
-
/* buffers to store authentication data in, as parsed from input options */
struct curltime keeps_speed; /* for the progress meter really */
@@ -1339,6 +1337,7 @@ struct UrlState {
following not keep sending user+password... This is
strdup() data.
*/
+ int retrycount; /* number of retries on a new connection */
int first_remote_port; /* remote port of the first (not followed) request */
struct Curl_ssl_session *session; /* array of 'max_ssl_sessions' size */
long sessionage; /* number of the most recent session */
@@ -1408,6 +1407,12 @@ struct UrlState {
CURLU *uh; /* URL handle for the current parsed URL */
struct urlpieces up;
Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */
+ char *url; /* work URL, copied from UserDefined */
+ char *referer; /* referer string */
+ struct curl_slist *cookielist; /* list of cookie files set by
+ curl_easy_setopt(COOKIEFILE) calls */
+ struct curl_slist *resolve; /* set to point to the set.resolve list when
+ this should be dealt with in pretransfer */
#ifndef CURL_DISABLE_HTTP
size_t trailers_bytes_sent;
struct dynbuf trailers_buf; /* a buffer containing the compiled trailing
@@ -1465,34 +1470,16 @@ struct UrlState {
BIT(use_range);
BIT(rangestringalloc); /* the range string is malloc()'ed */
BIT(done); /* set to FALSE when Curl_init_do() is called and set to TRUE
- when multi_done() is called, to prevent multi_done() to get
- invoked twice when the multi interface is used. */
+ when multi_done() is called, to prevent multi_done() to get
+ invoked twice when the multi interface is used. */
BIT(stream_depends_e); /* set or don't set the Exclusive bit */
BIT(previouslypending); /* this transfer WAS in the multi->pending queue */
BIT(cookie_engine);
BIT(prefer_ascii); /* ASCII rather than binary */
BIT(list_only); /* list directory contents */
-};
-
-
-/*
- * This 'DynamicStatic' struct defines dynamic states that actually change
- * values in the 'UserDefined' area, which MUST be taken into consideration
- * if the UserDefined struct is cloned or similar. You can probably just
- * copy these, but each one indicate a special action on other data.
- */
-
-struct DynamicStatic {
- char *url; /* work URL, copied from UserDefined */
- char *referer; /* referer string */
- struct curl_slist *cookielist; /* list of cookie files set by
- curl_easy_setopt(COOKIEFILE) calls */
- struct curl_slist *resolve; /* set to point to the set.resolve list when
- this should be dealt with in pretransfer */
BIT(url_alloc); /* URL string is malloc()'ed */
BIT(referer_alloc); /* referer string is malloc()ed */
- BIT(wildcard_resolve); /* Set to true if any resolve change is a
- wildcard */
+ BIT(wildcard_resolve); /* Set to true if any resolve change is a wildcard */
};
/*
@@ -1935,7 +1922,6 @@ struct Curl_easy {
#endif
struct SingleRequest req; /* Request-specific data */
struct UserDefined set; /* values set by the libcurl user */
- struct DynamicStatic change; /* possibly modified userdefined data */
struct CookieInfo *cookies; /* the cookies, read from files and servers.
NOTE that the 'cookie' field in the
UserDefined struct defines if the "engine"