Mercurial > dovecot > core-2.2
comparison src/lmtp/lmtp-proxy.c @ 22545:425ee3581927
lmtp proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 08 Sep 2017 11:02:07 +0300 |
parents | 2e2563132d5f |
children | cb108f786fb4 |
comparison
equal
deleted
inserted
replaced
22544:3b6fb61e5fb1 | 22545:425ee3581927 |
---|---|
144 client_set.proxy_ttl = proxy->set.proxy_ttl; | 144 client_set.proxy_ttl = proxy->set.proxy_ttl; |
145 client_set.proxy_timeout_secs = set->timeout_msecs/1000; | 145 client_set.proxy_timeout_secs = set->timeout_msecs/1000; |
146 | 146 |
147 conn = p_new(proxy->pool, struct lmtp_proxy_connection, 1); | 147 conn = p_new(proxy->pool, struct lmtp_proxy_connection, 1); |
148 conn->proxy = proxy; | 148 conn->proxy = proxy; |
149 conn->set.host = p_strdup(proxy->pool, set->host); | 149 if (set->hostip.family == 0) |
150 conn->set.host = p_strdup(proxy->pool, set->host); | |
151 else | |
152 conn->set.host = p_strdup(proxy->pool, net_ip2addr(&set->hostip)); | |
150 conn->set.port = set->port; | 153 conn->set.port = set->port; |
151 conn->set.timeout_msecs = set->timeout_msecs; | 154 conn->set.timeout_msecs = set->timeout_msecs; |
152 array_append(&proxy->connections, &conn, 1); | 155 array_append(&proxy->connections, &conn, 1); |
153 | 156 |
154 conn->client = lmtp_client_init(&client_set, lmtp_conn_finish, conn); | 157 conn->client = lmtp_client_init(&client_set, lmtp_conn_finish, conn); |