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

@ -44,6 +44,7 @@
#include "rand.h"
#include "curlx/strparse.h"
#include "transfer.h"
#include "bufref.h"
#include "curlx/dynbuf.h"
#include "curlx/warnless.h"
#include "headers.h"
@ -920,10 +921,7 @@ fail:
if(rc)
return rc;
if(data->state.url_alloc)
curlx_free(data->state.url);
data->state.url_alloc = TRUE;
data->state.url = url;
Curl_bufref_set(&data->state.url, url, 0, curl_free);
return 0;
}
@ -2316,7 +2314,7 @@ static CURLcode h2_submit(struct h2_stream_ctx **pstream,
size_t acc = 0, i;
infof(data, "[HTTP/2] [%d] OPENED stream for %s",
stream_id, data->state.url);
stream_id, Curl_bufref_ptr(&data->state.url));
for(i = 0; i < nheader; ++i) {
acc += nva[i].namelen + nva[i].valuelen;