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
Debug: indent lookup operations
[exim.git]
/
src
/
src
/
lookups
/
ibase.c
diff --git
a/src/src/lookups/ibase.c
b/src/src/lookups/ibase.c
index acf9787a1083fb31eb230efc162a6a93f15df7e4..eab3c6ad8126dbfba715f59fb26ef2e7fd5b15b8 100644
(file)
--- a/
src/src/lookups/ibase.c
+++ b/
src/src/lookups/ibase.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. */
/* The code in this module was contributed by Ard Biesheuvel. */
/* See the file NOTICE for conditions of use and distribution. */
/* The code in this module was contributed by Ard Biesheuvel. */
@@
-51,7
+51,7
@@
static void ibase_tidy(void)
while ((cn = ibase_connections) != NULL) {
ibase_connections = cn->next;
while ((cn = ibase_connections) != NULL) {
ibase_connections = cn->next;
- DEBUG(D_lookup) debug_printf("close Interbase connection: %s\n",
+ DEBUG(D_lookup) debug_printf
_indent
("close Interbase connection: %s\n",
cn->server);
isc_commit_transaction(status, &cn->transh);
isc_detach_database(status, &cn->dbh);
cn->server);
isc_commit_transaction(status, &cn->transh);
isc_detach_database(status, &cn->dbh);
@@
-112,12
+112,12
@@
perform_ibase_search(uschar * query, uschar * server, uschar ** resultptr,
isc_stmt_handle stmth = NULL;
XSQLDA *out_sqlda;
XSQLVAR *var;
isc_stmt_handle stmth = NULL;
XSQLDA *out_sqlda;
XSQLVAR *var;
+int i;
char buffer[256];
ISC_STATUS status[20], *statusp = status;
gstring * result;
char buffer[256];
ISC_STATUS status[20], *statusp = status;
gstring * result;
-int i;
int yield = DEFER;
ibase_connection *cn;
uschar *server_copy = NULL;
int yield = DEFER;
ibase_connection *cn;
uschar *server_copy = NULL;
@@
-128,7
+128,7
@@
database, user, password. We can write to the string, since it is in a
nextinlist temporary buffer. The copy of the string that is used for caching
has the password removed. This copy is also used for debugging output. */
nextinlist temporary buffer. The copy of the string that is used for caching
has the password removed. This copy is also used for debugging output. */
-for (i = 2; i > 0; i--)
+for (i
nt i
= 2; i > 0; i--)
{
uschar *pp = Ustrrchr(server, '|');
{
uschar *pp = Ustrrchr(server, '|');
@@
-170,10
+170,8
@@
if (cn)
isc_detach_database(status, &cn->dbh);
}
else
isc_detach_database(status, &cn->dbh);
}
else
- {
- DEBUG(D_lookup) debug_printf("Interbase using cached connection for %s\n",
+ DEBUG(D_lookup) debug_printf_indent("Interbase using cached connection for %s\n",
server_copy);
server_copy);
- }
}
else
{
}
else
{
@@
-189,7
+187,7
@@
else
if (cn->dbh == NULL || cn->transh == NULL)
{
if (cn->dbh == NULL || cn->transh == NULL)
{
- char *dpb
, *p
;
+ char *dpb;
short dpb_length;
static char trans_options[] =
{ isc_tpb_version3, isc_tpb_read, isc_tpb_read_committed,
short dpb_length;
static char trans_options[] =
{ isc_tpb_version3, isc_tpb_read, isc_tpb_read_committed,
@@
-201,16
+199,16
@@
if (cn->dbh == NULL || cn->transh == NULL)
*dpb++ = isc_dpb_version1;
*dpb++ = isc_dpb_user_name;
*dpb++ = strlen(sdata[1]);
*dpb++ = isc_dpb_version1;
*dpb++ = isc_dpb_user_name;
*dpb++ = strlen(sdata[1]);
- for (p = sdata[1]; *p;)
+ for (
char *
p = sdata[1]; *p;)
*dpb++ = *p++;
*dpb++ = isc_dpb_password;
*dpb++ = strlen(sdata[2]);
*dpb++ = *p++;
*dpb++ = isc_dpb_password;
*dpb++ = strlen(sdata[2]);
- for (p = sdata[2]; *p;)
+ for (
char *
p = sdata[2]; *p;)
*dpb++ = *p++;
dpb_length = dpb - buffer;
DEBUG(D_lookup)
*dpb++ = *p++;
dpb_length = dpb - buffer;
DEBUG(D_lookup)
- debug_printf("new Interbase connection: database=%s user=%s\n",
+ debug_printf
_indent
("new Interbase connection: database=%s user=%s\n",
sdata[0], sdata[1]);
/* Connect to the database */
sdata[0], sdata[1]);
/* Connect to the database */
@@
-373,7
+371,7
@@
while (isc_dsql_fetch(status, &stmth, out_sqlda->version, out_sqlda) != 100L)
}
else
}
else
- for (i = 0; i < out_sqlda->sqld; i++)
+ for (i
nt i
= 0; i < out_sqlda->sqld; i++)
{
int len = fetch_field(buffer, sizeof(buffer), &out_sqlda->sqlvar[i]);
{
int len = fetch_field(buffer, sizeof(buffer), &out_sqlda->sqlvar[i]);
@@
-388,10
+386,8
@@
while (isc_dsql_fetch(status, &stmth, out_sqlda->version, out_sqlda) != 100L)
else if (buffer[0] == 0 || Ustrchr(buffer, ' ') != NULL)
{
else if (buffer[0] == 0 || Ustrchr(buffer, ' ') != NULL)
{
- int j;
-
result = string_catn(result, US "\"", 1);
result = string_catn(result, US "\"", 1);
- for (j = 0; j < len; j++)
+ for (
int
j = 0; j < len; j++)
{
if (buffer[j] == '\"' || buffer[j] == '\\')
result = string_cat(result, US "\\", 1);
{
if (buffer[j] == '\"' || buffer[j] == '\\')
result = string_cat(result, US "\\", 1);
@@
-434,7
+430,7
@@
if (result)
}
else
{
}
else
{
- DEBUG(D_lookup) debug_printf("%s\n", *errmsg);
+ DEBUG(D_lookup) debug_printf
_indent
("%s\n", *errmsg);
return yield; /* FAIL or DEFER */
}
}
return yield; /* FAIL or DEFER */
}
}
@@
-462,7
+458,7
@@
ibase_find(void *handle, uschar * filename, uschar * query, int length,
/* Keep picky compilers happy */
do_cache = do_cache;
/* Keep picky compilers happy */
do_cache = do_cache;
- DEBUG(D_lookup) debug_printf("Interbase query: %s\n", query);
+ DEBUG(D_lookup) debug_printf
_indent
("Interbase query: %s\n", query);
while ((server =
string_nextinlist(&list, &sep, buffer,
while ((server =
string_nextinlist(&list, &sep, buffer,