git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spelling fixes
[exim.git]
/
src
/
src
/
routers
/
iplookup.c
diff --git
a/src/src/routers/iplookup.c
b/src/src/routers/iplookup.c
index 34edf439d995cfcd464ed640c01d07bf36b5df5f..ff67af38dd8b512832ee8c1aca559829533e3379 100644
(file)
--- a/
src/src/routers/iplookup.c
+++ b/
src/src/routers/iplookup.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 201
7
*/
+/* Copyright (c) University of Cambridge 1995 - 201
8
*/
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
@@
-230,7
+230,8
@@
while ((hostname = string_nextinlist(&listptr, &sep, host_buffer,
for (h = host; h; h = h->next)
{
for (h = host; h; h = h->next)
{
- int host_af, query_socket;
+ int host_af;
+ client_conn_ctx query_cctx = {0};
/* Skip any hosts for which we have no address */
/* Skip any hosts for which we have no address */
@@
-241,9
+242,9
@@
while ((hostname = string_nextinlist(&listptr, &sep, host_buffer,
host_af = (Ustrchr(h->address, ':') != NULL)? AF_INET6 : AF_INET;
host_af = (Ustrchr(h->address, ':') != NULL)? AF_INET6 : AF_INET;
- query_
socket
= ip_socket(ob->protocol == ip_udp ? SOCK_DGRAM:SOCK_STREAM,
+ query_
cctx.sock
= ip_socket(ob->protocol == ip_udp ? SOCK_DGRAM:SOCK_STREAM,
host_af);
host_af);
- if (query_
socket
< 0)
+ if (query_
cctx.sock
< 0)
{
if (ob->optional) return PASS;
addr->message = string_sprintf("failed to create socket in %s router",
{
if (ob->optional) return PASS;
addr->message = string_sprintf("failed to create socket in %s router",
@@
-256,10
+257,10
@@
while ((hostname = string_nextinlist(&listptr, &sep, host_buffer,
router will timeout later on the read call). */
/*XXX could take advantage of TFO */
router will timeout later on the read call). */
/*XXX could take advantage of TFO */
- if (ip_connect(query_
socket
, host_af, h->address,ob->port, ob->timeout,
+ if (ip_connect(query_
cctx.sock
, host_af, h->address,ob->port, ob->timeout,
ob->protocol == ip_udp ? NULL : &tcp_fastopen_nodata) < 0)
{
ob->protocol == ip_udp ? NULL : &tcp_fastopen_nodata) < 0)
{
- close(query_
socket
);
+ close(query_
cctx.sock
);
DEBUG(D_route)
debug_printf("connection to %s failed: %s\n", h->address,
strerror(errno));
DEBUG(D_route)
debug_printf("connection to %s failed: %s\n", h->address,
strerror(errno));
@@
-268,18
+269,18
@@
while ((hostname = string_nextinlist(&listptr, &sep, host_buffer,
/* Send the query. If it fails, just continue with the next address. */
/* Send the query. If it fails, just continue with the next address. */
- if (send(query_
socket
, query, query_len, 0) < 0)
+ if (send(query_
cctx.sock
, query, query_len, 0) < 0)
{
DEBUG(D_route) debug_printf("send to %s failed\n", h->address);
{
DEBUG(D_route) debug_printf("send to %s failed\n", h->address);
- (void)close(query_
socket
);
+ (void)close(query_
cctx.sock
);
continue;
}
/* Read the response and close the socket. If the read fails, try the
next IP address. */
continue;
}
/* Read the response and close the socket. If the read fails, try the
next IP address. */
- count = ip_recv(
query_socket
, reply, sizeof(reply) - 1, ob->timeout);
- (void)close(query_
socket
);
+ count = ip_recv(
&query_cctx
, reply, sizeof(reply) - 1, ob->timeout);
+ (void)close(query_
cctx.sock
);
if (count <= 0)
{
DEBUG(D_route) debug_printf("%s from %s\n", (errno == ETIMEDOUT)?
if (count <= 0)
{
DEBUG(D_route) debug_printf("%s from %s\n", (errno == ETIMEDOUT)?
@@
-403,7
+404,7
@@
addr->child_count++;
new_addr->next = *addr_new;
*addr_new = new_addr;
new_addr->next = *addr_new;
*addr_new = new_addr;
-/* Set up the errors address, if any, and the additional and remov
e
able headers
+/* Set up the errors address, if any, and the additional and removable headers
for this new address. */
rc = rf_get_errors_address(addr, rblock, verify, &new_addr->prop.errors_address);
for this new address. */
rc = rf_get_errors_address(addr, rblock, verify, &new_addr->prop.errors_address);