{
struct http_client_peer_pool *ppool;
struct ssl_iostream_context *ssl_ctx = client->ssl_ctx;
- const char *rawlog_dir = client->set->rawlog_dir;
+ const char *rawlog_dir =
+ (client->set->rawlog_dir != NULL &&
+ client->set->rawlog_dir[0] != '\0') ?
+ client->set->rawlog_dir : NULL;
i_assert(!http_client_peer_addr_is_https(&pshared->addr) ||
ssl_ctx != NULL);
const char *proxy_socket_path = client->set->proxy_socket_path;
const struct http_url *proxy_url = client->set->proxy_url;
bool have_proxy =
- ((proxy_socket_path != NULL) || (proxy_url != NULL) ||
+ ((proxy_socket_path != NULL && proxy_socket_path[0] != '\0') ||
+ (proxy_url != NULL) ||
(req->host_socket != NULL) || (req->host_url != NULL));
const char *authority, *target;
/* Tunnel to origin server */
req->host_url = &req->origin_url;
req->ssl_tunnel = TRUE;
- } else if (proxy_socket_path != NULL) {
+ } else if (proxy_socket_path != NULL &&
+ proxy_socket_path[0] != '\0') {
/* Proxy on unix socket */
req->host_socket = proxy_socket_path;
req->host_url = NULL;
str_append(rtext, "\r\n");
}
if (http_client_request_to_proxy(req) &&
- set->proxy_username != NULL && set->proxy_password != NULL) {
+ set->proxy_username != NULL && set->proxy_username[0] != '\0' &&
+ set->proxy_password != NULL) {
struct http_auth_credentials auth_creds;
http_auth_basic_credentials_init(&auth_creds,
http_auth_create_credentials(rtext, &auth_creds);
str_append(rtext, "\r\n");
}
- if (!req->have_hdr_user_agent && req->client->set->user_agent != NULL) {
+ if (!req->have_hdr_user_agent && req->client->set->user_agent != NULL &&
+ req->client->set->user_agent[0] != '\0') {
str_printfa(rtext, "User-Agent: %s\r\n",
req->client->set->user_agent);
}
if (cctx->dns_client == NULL)
cctx->dns_client = client->dns_client;
- if (cctx->dns_client_socket_path == NULL) {
+ if (cctx->dns_client_socket_path == NULL &&
+ client->set->dns_client_socket_path != NULL &&
+ client->set->dns_client_socket_path[0] != '\0') {
cctx->dns_client_socket_path =
client->set->dns_client_socket_path;
}