Skip to content

Commit

Permalink
lib-http: Cleanup - Add name parameter to http_client_host_create()
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Dec 13, 2017
1 parent b254b8e commit a79ae29
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib-http/http-client-host.c
Expand Up @@ -245,13 +245,14 @@ http_client_host_shared_refresh(struct http_client_host_shared *hshared)
}

static struct http_client_host_shared *http_client_host_shared_create
(struct http_client_context *cctx)
(struct http_client_context *cctx, const char *name)
{
struct http_client_host_shared *hshared;

// FIXME: limit the maximum number of inactive cached hosts
hshared = i_new(struct http_client_host_shared, 1);
hshared->cctx = cctx;
hshared->name = i_strdup(name);
DLLIST_PREPEND(&cctx->hosts_list, hshared);

return hshared;
Expand All @@ -267,7 +268,7 @@ http_client_host_shared_get
if (host_url == NULL) {
hshared = cctx->unix_host;
if (hshared == NULL) {
hshared = http_client_host_shared_create(cctx);
hshared = http_client_host_shared_create(cctx, "[unix]");
hshared->name = i_strdup("[unix]");
hshared->unix_local = TRUE;

Expand All @@ -282,8 +283,7 @@ http_client_host_shared_get

hshared = hash_table_lookup(cctx->hosts, hostname);
if (hshared == NULL) {
hshared = http_client_host_shared_create(cctx);
hshared->name = i_strdup(hostname);
hshared = http_client_host_shared_create(cctx, hostname);
hostname = hshared->name;
hash_table_insert(cctx->hosts, hostname, hshared);

Expand Down

0 comments on commit a79ae29

Please sign in to comment.