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
Rename substructure for ease of debugging
[exim.git]
/
src
/
src
/
routers
/
iplookup.c
diff --git
a/src/src/routers/iplookup.c
b/src/src/routers/iplookup.c
index 8c17c62faa3a4852d1cacbbf13489267894d5354..33329f887ec1ac1b3aeeb74fd88abe1c312de8c8 100644
(file)
--- a/
src/src/routers/iplookup.c
+++ b/
src/src/routers/iplookup.c
@@
-1,10
+1,8
@@
-/* $Cambridge: exim/src/src/routers/iplookup.c,v 1.6 2006/02/07 11:19:02 ph10 Exp $ */
-
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 200
6
*/
+/* Copyright (c) University of Cambridge 1995 - 200
9
*/
/* See the file NOTICE for conditions of use and distribution. */
/* See the file NOTICE for conditions of use and distribution. */
@@
-144,8
+142,9
@@
iplookup_router_entry(
address_item **addr_succeed) /* put old address here on success */
{
uschar *query = NULL;
address_item **addr_succeed) /* put old address here on success */
{
uschar *query = NULL;
-uschar reply[256];
-uschar *hostname, *reroute, *domain, *listptr;
+uschar *reply;
+uschar *hostname, *reroute, *domain;
+const uschar *listptr;
uschar host_buffer[256];
host_item *host = store_get(sizeof(host_item));
address_item *new_addr;
uschar host_buffer[256];
host_item *host = store_get(sizeof(host_item));
address_item *new_addr;
@@
-163,6
+162,8
@@
pw = pw;
DEBUG(D_route) debug_printf("%s router called for %s: domain = %s\n",
rblock->name, addr->address, addr->domain);
DEBUG(D_route) debug_printf("%s router called for %s: domain = %s\n",
rblock->name, addr->address, addr->domain);
+reply = store_get(256);
+
/* Build the query string to send. If not explicitly given, a default of
"user@domain user@domain" is used. */
/* Build the query string to send. If not explicitly given, a default of
"user@domain user@domain" is used. */
@@
-206,7
+207,7
@@
while ((hostname = string_nextinlist(&listptr, &sep, host_buffer,
host->address = host->name;
else
{
host->address = host->name;
else
{
- int rc = host_find_byname(host, NULL, NULL, TRUE);
+ int rc = host_find_byname(host, NULL,
HOST_FIND_QUALIFY_SINGLE,
NULL, TRUE);
if (rc == HOST_FIND_FAILED || rc == HOST_FIND_AGAIN) continue;
}
if (rc == HOST_FIND_FAILED || rc == HOST_FIND_AGAIN) continue;
}
@@
-240,6
+241,7
@@
while ((hostname = string_nextinlist(&listptr, &sep, host_buffer,
if (ip_connect(query_socket, host_af, h->address,ob->port, ob->timeout) < 0)
{
if (ip_connect(query_socket, host_af, h->address,ob->port, ob->timeout) < 0)
{
+ close(query_socket);
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));
@@
-375,8
+377,11
@@
new_addr = deliver_make_addr(reroute, TRUE);
new_addr->parent = addr;
copyflag(new_addr, addr, af_propagate);
new_addr->parent = addr;
copyflag(new_addr, addr, af_propagate);
-new_addr->p
= addr->
p;
+new_addr->p
rop = addr->pro
p;
+if (addr->child_count == SHRT_MAX)
+ log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s router generated more than %d "
+ "child addresses for <%s>", rblock->name, SHRT_MAX, addr->address);
addr->child_count++;
new_addr->next = *addr_new;
*addr_new = new_addr;
addr->child_count++;
new_addr->next = *addr_new;
*addr_new = new_addr;
@@
-384,11
+389,11
@@
new_addr->next = *addr_new;
/* Set up the errors address, if any, and the additional and removeable headers
for this new address. */
/* Set up the errors address, if any, and the additional and removeable headers
for this new address. */
-rc = rf_get_errors_address(addr, rblock, verify, &
(new_addr->p.errors_address)
);
+rc = rf_get_errors_address(addr, rblock, verify, &
new_addr->prop.errors_address
);
if (rc != OK) return rc;
if (rc != OK) return rc;
-rc = rf_get_munge_headers(addr, rblock, &
(new_addr->p.extra_headers)
,
- &
(new_addr->p.remove_headers)
);
+rc = rf_get_munge_headers(addr, rblock, &
new_addr->prop.extra_headers
,
+ &
new_addr->prop.remove_headers
);
if (rc != OK) return rc;
return OK;
if (rc != OK) return rc;
return OK;