lib: turn state.url into a struct bufref

Closes #19827
This commit is contained in:
Patrick Monnerat 2025-12-03 23:15:18 +01:00 committed by Daniel Stenberg
parent f39b8a1174
commit 36542b7349
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
16 changed files with 67 additions and 82 deletions

View file

@ -53,6 +53,7 @@
#include "socketpair.h"
#include "socks.h"
#include "urlapi-int.h"
#include "bufref.h"
/* initial multi->xfers table size for a full multi */
#define CURL_XFER_TABLE_SIZE 512
@ -2006,7 +2007,7 @@ static CURLMcode state_performing(struct Curl_easy *data,
data->state.errorbuf = FALSE;
if(!newurl)
/* typically for HTTP_1_1_REQUIRED error on first flight */
newurl = curlx_strdup(data->state.url);
newurl = curlx_strdup(Curl_bufref_ptr(&data->state.url));
if(!newurl) {
result = CURLE_OUT_OF_MEMORY;
}
@ -4066,7 +4067,7 @@ static void multi_xfer_dump(struct Curl_multi *multi, uint32_t mid,
", url=%s\n",
mid,
(data->magic == CURLEASY_MAGIC_NUMBER) ? "GOOD" : "BAD!",
(void *)data, data->id, data->state.url);
(void *)data, data->id, Curl_bufref_ptr(&data->state.url));
}
}