Plumbing ownership further; some things became C++

This commit is contained in:
2025-04-14 03:48:28 -04:00
parent 76bae93e1c
commit d4a69c0b11
30 changed files with 192 additions and 193 deletions

View File

@ -98,7 +98,7 @@ static int Cache_entry_cmp(const void *v1, const void *v2)
{
const CacheEntry_t *d1 = reinterpret_cast< const CacheEntry_t * >( v1 ), *d2 = reinterpret_cast< const CacheEntry_t * >( v2 );
return a_Url_cmp(*d1->Url, *d2->Url);
return a_Url_cmp(d1->Url, d2->Url);
}
/**
@ -109,7 +109,7 @@ static int Cache_entry_by_url_cmp(const void *v1, const void *v2)
const DilloUrl *u1 = reinterpret_cast< const CacheEntry_t * >( v1 )->Url;
const DilloUrl *u2 = reinterpret_cast< const DilloUrl * >( v2 );
return a_Url_cmp(*u1, *u2);
return a_Url_cmp(u1, u2);
}
/**
@ -191,7 +191,7 @@ static void Cache_client_dequeue(CacheClient_t *Client)
*/
static void Cache_entry_init(CacheEntry_t *NewEntry, const DilloUrl *Url)
{
NewEntry->Url = a_Url_dup(*Url).release();
NewEntry->Url = a_Url_dup(Url).release();
NewEntry->TypeDet = NULL;
NewEntry->TypeHdr = NULL;
NewEntry->TypeMeta = NULL;
@ -1025,7 +1025,7 @@ static int Cache_redirect(CacheEntry_t *entry, int Flags, BrowserWindow *bw)
/* Redirection of the main page */
auto NewUrl = a_Url_new(URL_STR_(entry->Location), URL_STR_(entry->Url));
if (entry->Flags & CA_TempRedirect)
a_Url_set_flags(*NewUrl, URL_FLAGS(NewUrl) | URL_E2EQuery);
a_Url_set_flags(NewUrl.get(), URL_FLAGS(NewUrl) | URL_E2EQuery);
a_Nav_push(bw, NewUrl.get(), entry->Url);
} else {
/* Sub entity redirection (most probably an image) */
@ -1076,7 +1076,7 @@ static void Cache_auth_entry(CacheEntry_t *entry, BrowserWindow *bw)
busy = 1;
data = dNew(CacheAuthData_t, 1);
data->auth = entry->Auth;
data->url = a_Url_dup(*entry->Url).release();
data->url = a_Url_dup(entry->Url).release();
data->bw = bw;
entry->Auth = NULL;
a_Timeout_add(0.0, Cache_auth_callback, data);
@ -1325,7 +1325,7 @@ static CacheEntry_t *Cache_process_queue(CacheEntry_t *entry)
if (AbortEntry) {
/* Abort the entry, remove it from cache, and maybe offer download. */
DilloUrl *url = a_Url_dup(*entry->Url).release();
DilloUrl *url = a_Url_dup(entry->Url).release();
a_Capi_conn_abort_by_url(url);
entry = NULL;
if (OfferDownload) {
@ -1334,7 +1334,7 @@ static CacheEntry_t *Cache_process_queue(CacheEntry_t *entry)
if (a_Cache_download_enabled(url)) {
Cache_savelink_t *data = dNew(Cache_savelink_t, 1);
data->bw = Client_bw;
data->url = a_Url_dup(*url).release();
data->url = a_Url_dup(url).release();
a_Timeout_add(0.0, Cache_savelink_cb, data);
}
}