Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
6107ba67
Commit
6107ba67
authored
Jul 11, 2002
by
Julius Enarusai
Browse files
Coverted LDAP_LOG macro to use subsystem ID int values instead of string values
parent
2adfd47e
Changes
177
Hide whitespace changes
Inline
Side-by-side
clients/tools/ldapmodify.c
View file @
6107ba67
...
...
@@ -582,10 +582,6 @@ main( int argc, char **argv )
(
void
)
SIGNAL
(
SIGPIPE
,
SIG_IGN
);
#endif
#ifdef NEW_LOGGING
lutil_log_initialize
(
argc
,
argv
);
#endif
if
(
!
not
)
{
if
(
(
ldaphost
!=
NULL
||
ldapport
)
&&
(
ldapuri
==
NULL
)
)
{
if
(
verbose
)
{
...
...
include/ldap_log.h
View file @
6107ba67
...
...
@@ -35,21 +35,29 @@ LDAP_BEGIN_DECL
* reflect the number of subsystems and LDAP_SUBSYS_MAX reflect
* the largest subsystem number.
*/
#define LDAP_SUBSYS_NUM
1
2
#define LDAP_SUBSYS_MAX 1
1
#define LDAP_SUBSYS_NUM 2
0
#define LDAP_SUBSYS_MAX 1
9
#define LDAP_SUBSYS_GLOBAL 0
#define LDAP_SUBSYS_OPERATION 1
#define LDAP_SUBSYS_TRANSPORT 2
#define LDAP_SUBSYS_CONNECTION 3
#define LDAP_SUBSYS_FILTER 4
#define LDAP_SUBSYS_BACKEND 5
#define LDAP_SUBSYS_BER 6
#define LDAP_SUBSYS_CONFIG 7
#define LDAP_SUBSYS_ACL 8
#define LDAP_SUBSYS_CACHE 9
#define LDAP_SUBSYS_INDEX 10
#define LDAP_SUBSYS_LDIF 11
#define LDAP_SUBSYS_BER 5
#define LDAP_SUBSYS_CONFIG 6
#define LDAP_SUBSYS_ACL 7
#define LDAP_SUBSYS_CACHE 8
#define LDAP_SUBSYS_INDEX 9
#define LDAP_SUBSYS_LDIF 10
#define LDAP_SUBSYS_TOOLS 11
#define LDAP_SUBSYS_SLAPD 12
#define LDAP_SUBSYS_SLURPD 13
#define LDAP_SUBSYS_BACKEND 14
#define LDAP_SUBSYS_BACK_BDB 15
#define LDAP_SUBSYS_BACK_LDBM 16
#define LDAP_SUBSYS_BACK_LDAP 17
#define LDAP_SUBSYS_BACK_META 18
#define LDAP_SUBSYS_BACK_MON 19
/*
* debug reporting levels.
...
...
@@ -125,27 +133,37 @@ LDAP_BEGIN_DECL
} while ( 0 )
# endif
#ifndef LDAP_LOG
# define LDAP_LOG(a) lutil_log a
#endif
#else
/* LDAP_DEBUG */
# define Debug( level, fmt, arg1, arg2, arg3 )
#ifndef LDAP_LOG
# define LDAP_LOG(a)
#endif
#endif
/* LDAP_DEBUG */
#ifdef NEW_LOGGING
extern
int
ldap_loglevels
[
LDAP_SUBSYS_NUM
];
#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3) do {\
if (ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \
ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)\
lutil_log (LDAP_SUBSYS_##a, LDAP_LEVEL_##b, fmt, arg1, arg2, arg3); \
} while (0)
#define LDAP_LOGS_TEST(a, b) \
(ldap_loglevels[LDAP_SUBSYS_##a] >= LDAP_LEVEL_##b || \
ldap_loglevels[LDAP_SUBSYS_GLOBAL] >= LDAP_LEVEL_##b)
#endif
/* LDAP_LOG */
#ifndef LDAP_LOG
#define LDAP_LOG(a, b, fmt, arg1, arg2, arg3)
#endif
LDAP_LUTIL_F
(
int
)
lutil_mnem2level
LDAP_P
((
const
char
*
level
));
LDAP_LUTIL_F
(
void
)
lutil_log_initialize
LDAP_P
((
int
argc
,
char
**
argv
));
LDAP_LUTIL_F
(
void
)
lutil_set_debug_level
LDAP_P
((
LDAP_LUTIL_F
(
int
)
lutil_set_debug_level
LDAP_P
((
const
char
*
subsys
,
int
level
));
LDAP_LUTIL_F
(
void
)
lutil_log
LDAP_P
((
const
char
*
subsys
,
int
level
,
const
char
*
fmt
,
...
));
const
int
subsys
,
int
level
,
const
char
*
fmt
,
...
));
LDAP_LUTIL_F
(
int
)
lutil_debug_file
LDAP_P
((
FILE
*
file
));
...
...
libraries/liblber/Makefile.in
View file @
6107ba67
...
...
@@ -12,16 +12,16 @@ NT_OBJS = nt_err.lo
LIB_DEFS
=
-DLBER_LIBRARY
SRCS
=
assert.c decode.c encode.c io.c bprint.c
\
SRCS
=
assert.c decode.c encode.c io.c bprint.c
debug.c
\
memory.c options.c sockbuf.c
$
(
@PLAT@_SRCS
)
OBJS
=
assert.lo decode.lo encode.lo io.lo bprint.lo
\
OBJS
=
assert.lo decode.lo encode.lo io.lo bprint.lo
debug.lo
\
memory.lo options.lo sockbuf.lo
$
(
@PLAT@_OBJS
)
XSRCS
=
version.c
PROGRAMS
=
dtest etest idtest
LDAP_INCDIR
=
../../include
LDAP_LIBDIR
=
../../libraries
LDAP_INCDIR
=
../../include
LDAP_LIBDIR
=
../../libraries
XLIBS
=
$(LIBRARY)
XXLIBS
=
...
...
libraries/liblber/decode.c
View file @
6107ba67
...
...
@@ -643,8 +643,10 @@ ber_scanf ( BerElement *ber,
fmt_reset
=
fmt
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"liblber"
,
LDAP_LEVEL_ENTRY
,
"ber_scanf fmt (%s) ber:
\n
"
,
fmt
));
BER_DUMP
((
"liblber"
,
LDAP_LEVEL_DETAIL2
,
ber
,
1
));
LDAP_LOG
(
BER
,
ENTRY
,
"ber_scanf fmt (%s) ber:
\n
"
,
fmt
,
0
,
0
);
if
(
LDAP_LOGS_TEST
(
BER
,
DETAIL2
))
BER_DUMP
((
"liblber"
,
LDAP_LEVEL_DETAIL2
,
ber
,
1
));
#else
ber_log_printf
(
LDAP_DEBUG_TRACE
,
ber
->
ber_debug
,
"ber_scanf fmt (%s) ber:
\n
"
,
fmt
);
...
...
@@ -796,8 +798,8 @@ ber_scanf ( BerElement *ber,
default:
if
(
ber
->
ber_debug
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"liblber"
,
LDAP_LEVEL_
ERR
,
"ber_scanf: unknown fmt %c
\n
"
,
*
fmt
)
);
LDAP_LOG
(
BER
,
ERR
,
"ber_scanf: unknown fmt %c
\n
"
,
*
fmt
,
0
,
0
);
#else
ber_log_printf
(
LDAP_DEBUG_ANY
,
ber
->
ber_debug
,
"ber_scanf: unknown fmt %c
\n
"
,
*
fmt
);
...
...
libraries/liblber/encode.c
View file @
6107ba67
...
...
@@ -812,8 +812,8 @@ ber_printf( BerElement *ber, LDAP_CONST char *fmt, ... )
default:
if
(
ber
->
ber_debug
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"liblber"
,
LDAP_LEVEL_
ERR
,
"ber_printf: unknown fmt %c
\n
"
,
*
fmt
)
);
LDAP_LOG
(
BER
,
ERR
,
"ber_printf: unknown fmt %c
\n
"
,
*
fmt
,
0
,
0
);
#else
ber_log_printf
(
LDAP_DEBUG_ANY
,
ber
->
ber_debug
,
"ber_printf: unknown fmt %c
\n
"
,
*
fmt
);
...
...
libraries/liblber/io.c
View file @
6107ba67
...
...
@@ -33,6 +33,7 @@
#endif
#include
"lber-int.h"
#include
"ldap_log.h"
ber_slen_t
ber_read
(
...
...
@@ -207,11 +208,14 @@ ber_flush( Sockbuf *sb, BerElement *ber, int freeit )
if
(
sb
->
sb_debug
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"liblber"
,
LDAP_LEVEL_
DETAIL1
,
LDAP_LOG
(
BER
,
DETAIL1
,
"ber_flush: %ld bytes to sd %ld%s
\n
"
,
towrite
,
(
long
)
sb
->
sb_fd
,
ber
->
ber_rwptr
!=
ber
->
ber_buf
?
" (re-flush)"
:
""
));
BER_DUMP
((
"liblber"
,
LDAP_LEVEL_DETAIL2
,
ber
,
1
));
ber
->
ber_rwptr
!=
ber
->
ber_buf
?
" (re-flush)"
:
""
);
if
(
LDAP_LOGS_TEST
(
BER
,
DETAIL2
))
BER_DUMP
((
"liblber"
,
LDAP_LEVEL_DETAIL2
,
ber
,
1
));
#else
ber_log_printf
(
LDAP_DEBUG_ANY
,
sb
->
sb_debug
,
"ber_flush: %ld bytes to sd %ld%s
\n
"
,
...
...
@@ -441,7 +445,7 @@ ber_get_next(
assert
(
LBER_VALID
(
ber
)
);
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"liblber"
,
LDAP_LEVEL_
ENTRY
,
"ber_get_next: enter
\n
"
)
);
LDAP_LOG
(
BER
,
ENTRY
,
"ber_get_next: enter
\n
"
,
0
,
0
,
0
);
#else
ber_log_printf
(
LDAP_DEBUG_TRACE
,
ber
->
ber_debug
,
"ber_get_next
\n
"
);
...
...
@@ -550,9 +554,9 @@ ber_get_next(
return
LBER_DEFAULT
;
}
else
if
(
sb
->
sb_max_incoming
&&
ber
->
ber_len
>
sb
->
sb_max_incoming
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"liblber"
,
LDAP_LEVEL_
ERR
,
LDAP_LOG
(
BER
,
ERR
,
"ber_get_next: sockbuf_max_incoming limit hit "
"(%d > %d)
\n
"
,
ber
->
ber_len
,
sb
->
sb_max_incoming
)
);
"(%d > %d)
\n
"
,
ber
->
ber_len
,
sb
->
sb_max_incoming
,
0
);
#else
ber_log_printf
(
LDAP_DEBUG_CONNS
,
ber
->
ber_debug
,
"ber_get_next: sockbuf_max_incoming limit hit "
...
...
@@ -618,10 +622,11 @@ done:
*
len
=
ber
->
ber_len
;
if
(
ber
->
ber_debug
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"liblber"
,
LDAP_LEVEL_DETAIL1
,
"ber_get_next: tag 0x%lx len %ld
\n
"
,
ber
->
ber_tag
,
ber
->
ber_len
));
BER_DUMP
((
"liblber"
,
LDAP_LEVEL_DETAIL2
,
ber
,
1
));
LDAP_LOG
(
BER
,
DETAIL1
,
"ber_get_next: tag 0x%lx len %ld
\n
"
,
ber
->
ber_tag
,
ber
->
ber_len
,
0
);
if
(
LDAP_LOGS_TEST
(
BER
,
DETAIL2
))
BER_DUMP
((
"liblber"
,
LDAP_LEVEL_DETAIL2
,
ber
,
1
));
#else
ber_log_printf
(
LDAP_DEBUG_TRACE
,
ber
->
ber_debug
,
"ber_get_next: tag 0x%lx len %ld contents:
\n
"
,
...
...
libraries/liblber/lber-int.h
View file @
6107ba67
...
...
@@ -38,16 +38,20 @@ struct lber_options {
};
#ifdef NEW_LOGGING
/*
# ifdef LDAP_DEBUG
# ifdef LDAP_LOG
# undef LDAP_LOG
# endif
# define LDAP_LOG(a) ber_pvt_log_output a
*/
# define BER_DUMP(a) ber_output_dump a
/*
# else
# define LDAP_LOG(a)
# define BER_DUMP(a)
# endif
*/
#endif
LBER_F
(
int
)
ber_pvt_log_output
(
...
...
libraries/libldap/abandon.c
View file @
6107ba67
...
...
@@ -58,7 +58,7 @@ ldap_abandon_ext(
{
int
rc
;
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"abandon"
,
LDAP_LEVEL_
ARGS
,
"ldap_abandon_ext %d
\n
"
,
msgid
)
);
LDAP_LOG
(
OPERATION
,
ARGS
,
"ldap_abandon_ext %d
\n
"
,
msgid
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_abandon_ext %d
\n
"
,
msgid
,
0
,
0
);
#endif
...
...
@@ -86,7 +86,7 @@ int
ldap_abandon
(
LDAP
*
ld
,
int
msgid
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"abandon"
,
LDAP_LEVEL_
ARGS
,
"ldap_abandon %d
\n
"
,
msgid
)
);
LDAP_LOG
(
OPERATION
,
ARGS
,
"ldap_abandon %d
\n
"
,
msgid
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_abandon %d
\n
"
,
msgid
,
0
,
0
);
#endif
...
...
@@ -110,8 +110,7 @@ do_abandon(
LDAPRequest
*
lr
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"abandon"
,
LDAP_LEVEL_ARGS
,
"do_abandon %d, msgid %d
\n
"
,
origid
,
msgid
));
LDAP_LOG
(
OPERATION
,
ARGS
,
"do_abandon %d, msgid %d
\n
"
,
origid
,
msgid
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"do_abandon origid %d, msgid %d
\n
"
,
origid
,
msgid
,
0
);
...
...
libraries/libldap/add.c
View file @
6107ba67
...
...
@@ -100,7 +100,7 @@ ldap_add_ext(
int
i
,
rc
;
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"add"
,
LDAP_LEVEL_
ENTRY
,
"ldap_add_ext
\n
"
)
);
LDAP_LOG
(
OPERATION
,
ENTRY
,
"ldap_add_ext
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_add_ext
\n
"
,
0
,
0
,
0
);
#endif
...
...
libraries/libldap/bind.c
View file @
6107ba67
...
...
@@ -42,7 +42,7 @@
#include
<ac/time.h>
#include
"ldap-int.h"
#include
"ldap_log.h"
/*
* ldap_bind - bind to the ldap server (and X.500). The dn and password
...
...
@@ -61,7 +61,7 @@ int
ldap_bind
(
LDAP
*
ld
,
LDAP_CONST
char
*
dn
,
LDAP_CONST
char
*
passwd
,
int
authmethod
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"bind"
,
LDAP_LEVEL_
ENTRY
,
"ldap_bind
\n
"
)
);
LDAP_LOG
(
OPERATION
,
ENTRY
,
"ldap_bind
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_bind
\n
"
,
0
,
0
,
0
);
#endif
...
...
@@ -110,7 +110,7 @@ ldap_bind_s(
int
authmethod
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"bind"
,
LDAP_LEVEL_
ENTRY
,
"ldap_bind_s
\n
"
)
);
LDAP_LOG
(
OPERATION
,
ENTRY
,
"ldap_bind_s
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_bind_s
\n
"
,
0
,
0
,
0
);
#endif
...
...
libraries/libldap/cache.c
View file @
6107ba67
...
...
@@ -118,7 +118,7 @@ ldap_flush_cache( LDAP *ld )
assert
(
LDAP_VALID
(
ld
)
);
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
ENTRY
,
"ldap_flush_cache
\n
"
)
);
LDAP_LOG
(
CACHE
,
ENTRY
,
"ldap_flush_cache
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_flush_cache
\n
"
,
0
,
0
,
0
);
#endif
...
...
@@ -154,9 +154,9 @@ ldap_uncache_request( LDAP *ld, int msgid )
#ifndef LDAP_NOCACHE
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_ARGS
,
"ldap_uncache_request %d ld_cache %lx
\n
"
,
msgid
,
(
long
)
ld
->
ld_cache
)
);
LDAP_LOG
(
CACHE
,
ARGS
,
"ldap_uncache_request %d ld_cache %lx
\n
"
,
msgid
,
(
long
)
ld
->
ld_cache
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_uncache_request %d ld_cache %lx
\n
"
,
msgid
,
(
long
)
ld
->
ld_cache
,
0
);
...
...
@@ -176,9 +176,9 @@ ldap_uncache_entry( LDAP *ld, LDAP_CONST char *dn )
#ifndef LDAP_NOCACHE
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_ARGS
,
"ldap_uncache_entry %s ld_cache %lx
\n
"
,
dn
,
(
long
)
ld
->
ld_cache
)
);
LDAP_LOG
(
CACHE
,
ARGS
,
"ldap_uncache_entry %s ld_cache %lx
\n
"
,
dn
,
(
long
)
ld
->
ld_cache
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_uncache_entry %s ld_cache %lx
\n
"
,
dn
,
(
long
)
ld
->
ld_cache
,
0
);
...
...
@@ -200,9 +200,10 @@ uncache_entry_or_req( LDAP *ld,
LDAPMessage
*
m
,
*
prev
,
*
next
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_ARGS
,
LDAP_LOG
(
CACHE
,
ARGS
,
"uncache_entry_or_req dn %s msgid %ld ld_cache %lx
\n
"
,
dn
,
(
long
)
msgid
,
(
long
)
ld
->
ld_cache
)
);
dn
,
(
long
)
msgid
,
(
long
)
ld
->
ld_cache
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_uncache_entry_or_req dn %s msgid %ld ld_cache %lx
\n
"
,
...
...
@@ -266,7 +267,7 @@ ldap_add_request_to_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
assert
(
LDAP_VALID
(
ld
)
);
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
ENTRY
,
"ldap_add_request_to_cache
\n
"
)
);
LDAP_LOG
(
CACHE
,
ENTRY
,
"ldap_add_request_to_cache
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_add_request_to_cache
\n
"
,
0
,
0
,
0
);
#endif
...
...
@@ -318,9 +319,10 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
assert
(
result
!=
NULL
);
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_ARGS
,
LDAP_LOG
(
CACHE
,
ARGS
,
"ldap_add_result_to_cache: id %ld, type %ld
\n
"
,
(
long
)
result
->
lm_msgid
,
(
long
)
result
->
lm_msgtype
)
);
(
long
)
result
->
lm_msgid
,
(
long
)
result
->
lm_msgtype
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_add_result_to_cache: id %ld, type %ld
\n
"
,
(
long
)
result
->
lm_msgid
,
(
long
)
result
->
lm_msgtype
,
0
);
...
...
@@ -329,8 +331,8 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
if
(
ld
->
ld_cache
==
NULL
||
(
ld
->
ld_cache
->
lc_enabled
==
0
))
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
DETAIL1
,
"ldap_add_result_to_cache: cache disabled
\n
"
)
);
LDAP_LOG
(
CACHE
,
DETAIL1
,
"ldap_add_result_to_cache: cache disabled
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"artc: cache disabled
\n
"
,
0
,
0
,
0
);
#endif
...
...
@@ -345,9 +347,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
* only cache search and compare operations
*/
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
DETAIL1
,
"ldap_add_result_to_cache: "
"
only caching search &
compare operations
\n
"
)
);
LDAP_LOG
(
CACHE
,
DETAIL1
,
"ldap_add_result_to_cache:
only caching search &
"
"compare operations
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"artc: only caching search & compare operations
\n
"
,
0
,
0
,
0
);
...
...
@@ -376,9 +378,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
new
->
lm_chain
=
NULL
;
m
->
lm_chain
=
new
;
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
RESULTS
,
LDAP_LOG
(
CACHE
,
RESULTS
,
"ldap_add_result_to_cache: "
"result added to cache request chain
\n
"
)
);
"result added to cache request chain
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"artc: result added to cache request chain
\n
"
,
...
...
@@ -418,9 +420,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
if
(
!
keep
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
RESULTS
,
LDAP_LOG
(
CACHE
,
RESULTS
,
"ldap_add_result_to_cache: "
"not caching result with error
\n
"
)
);
"not caching result with error
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"artc: not caching result with error %d
\n
"
,
...
...
@@ -436,9 +438,9 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
ld
->
ld_cache
->
lc_memused
+=
msg_size
(
req
);
check_cache_memused
(
ld
->
ld_cache
);
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
RESULTS
,
LDAP_LOG
(
CACHE
,
RESULTS
,
"ldap_add_result_to_cache: "
"cached result with error
\n
"
)
);
"cached result with error
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"artc: cached result with error %d
\n
"
,
...
...
@@ -448,9 +450,8 @@ ldap_add_result_to_cache( LDAP *ld, LDAPMessage *result )
}
}
else
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_RESULTS
,
"ldap_add_result_to_cache: "
"msgid not in request list
\n
"
));
LDAP_LOG
(
CACHE
,
RESULTS
,
"ldap_add_result_to_cache: msgid not in request list
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"artc: msgid not in request list
\n
"
,
0
,
0
,
0
);
...
...
@@ -481,7 +482,7 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
assert
(
request
!=
NULL
);
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
ENTRY
,
"ldap_check_cache
\n
"
)
);
LDAP_LOG
(
CACHE
,
ENTRY
,
"ldap_check_cache
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_check_cache
\n
"
,
0
,
0
,
0
);
#endif
...
...
@@ -503,9 +504,9 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
hash
=
cache_hash
(
&
reqber
);
for
(
m
=
ld
->
ld_cache
->
lc_buckets
[
hash
];
m
!=
NULL
;
m
=
next
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
DETAIL1
,
LDAP_LOG
(
CACHE
,
DETAIL1
,
"ldap_check_cache: examining id %ld, type %ld
\n
"
,
(
long
)
m
->
lm_msgid
,
(
long
)
m
->
lm_msgtype
)
);
(
long
)
m
->
lm_msgid
,
(
long
)
m
->
lm_msgtype
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"cc: examining id %ld,type %ld
\n
"
,
(
long
)
m
->
lm_msgid
,
(
long
)
m
->
lm_msgtype
,
0
);
...
...
@@ -519,9 +520,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
prev
->
lm_next
=
next
;
}
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_DETAIL1
,
"ldap_check_cache: expired id %ld
\n
"
,
(
long
)
m
->
lm_msgid
));
LDAP_LOG
(
CACHE
,
DETAIL1
,
"ldap_check_cache: expired id %ld
\n
"
,
(
long
)
m
->
lm_msgid
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"cc: expired id %d
\n
"
,
m
->
lm_msgid
,
0
,
0
);
...
...
@@ -562,9 +562,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
}
prev
=
new
;
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_DETAIL1
,
"ldap_check_cache: added type %ld
\n
"
,
(
long
)
m
->
lm_msgtype
));
LDAP_LOG
(
CACHE
,
DETAIL1
,
"ldap_check_cache: added type %ld
\n
"
,
(
long
)
m
->
lm_msgtype
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"cc: added type %ld
\n
"
,
(
long
)
new
->
lm_msgtype
,
0
,
0
);
...
...
@@ -572,8 +571,8 @@ ldap_check_cache( LDAP *ld, ber_tag_t msgtype, BerElement *request )
}
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
RESULTS
,
"ldap_check_cache: result returned from cache
\n
"
)
);
LDAP_LOG
(
CACHE
,
RESULTS
,
"ldap_check_cache: result returned from cache
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"cc: result returned from cache
\n
"
,
0
,
0
,
0
);
#endif
...
...
@@ -603,9 +602,8 @@ cache_hash( BerElement *ber )
}
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_RESULTS
,
"cache_hash: len is %ld, returning %ld
\n
"
,
len
,
len
%
LDAP_CACHE_BUCKETS
));
LDAP_LOG
(
CACHE
,
RESULTS
,
"cache_hash: len is %ld, returning %ld
\n
"
,
len
,
len
%
LDAP_CACHE_BUCKETS
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"cache_hash: len is %ld, returning %ld
\n
"
,
len
,
len
%
LDAP_CACHE_BUCKETS
,
0
);
...
...
@@ -760,9 +758,9 @@ check_cache_memused( LDAPCache *lc )
LDAPMessage
*
m
,
*
prev
,
*
next
;
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
DETAIL1
,
LDAP_LOG
(
CACHE
,
DETAIL1
,
"check_cache_memused: %ld bytes in use (%ld max)
\n
"
,
lc
->
lc_memused
,
lc
->
lc_maxmem
)
);
lc
->
lc_memused
,
lc
->
lc_maxmem
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"check_cache_memused: %ld bytes in use (%ld max)
\n
"
,
lc
->
lc_memused
,
lc
->
lc_maxmem
,
0
);
...
...
@@ -789,9 +787,8 @@ check_cache_memused( LDAPCache *lc )
}
lc
->
lc_memused
-=
msg_size
(
m
);
#ifdef NEW_LOGGING
LDAP_LOG
((
"cache"
,
LDAP_LEVEL_DETAIL1
,
"check_cache_memused: removed %ld
\n
"
,
m
->
lm_msgid
));
LDAP_LOG
(
CACHE
,
DETAIL1
,
"check_cache_memused: removed %ld
\n
"
,
m
->
lm_msgid
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ccm: removed %d
\n
"
,
...
...
@@ -807,9 +804,9 @@ check_cache_memused( LDAPCache *lc )
}
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cache"
,
LDAP_LEVEL_
DETAIL1
,
"check_cache_memused: reduced usage to %ld bytes
\n
"
,
lc
->
lc_memused
)
);
LDAP_LOG
(
CACHE
,
DETAIL1
,
"check_cache_memused: reduced usage to %ld bytes
\n
"
,
lc
->
lc_memused
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ccm: reduced usage to %ld bytes
\n
"
,
lc
->
lc_memused
,
0
,
0
);
...
...
libraries/libldap/compare.c
View file @
6107ba67
...
...
@@ -29,6 +29,7 @@
#include
<ac/time.h>
#include
"ldap-int.h"
#include
"ldap_log.h"
/*
* ldap_compare_ext - perform an ldap extended compare operation. The dn
...
...
@@ -55,7 +56,7 @@ ldap_compare_ext(
BerElement
*
ber
;
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"compare"
,
LDAP_LEVEL_
ENTRY
,
"ldap_compare
\n
"
)
);
LDAP_LOG
(
OPERATION
,
ENTRY
,
"ldap_compare
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_compare
\n
"
,
0
,
0
,
0
);
#endif
...
...
libraries/libldap/cyrus.c
View file @
6107ba67
...
...
@@ -361,7 +361,7 @@ Sockbuf_IO ldap_pvt_sockbuf_io_sasl = {
int
ldap_pvt_sasl_install
(
Sockbuf
*
sb
,
void
*
ctx_arg
)
{
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cyrus"
,
LDAP_LEVEL_
ENTRY
,
"ldap_pvt_sasl_install
\n
"
)
);
LDAP_LOG
(
TRANSPORT
,
ENTRY
,
"ldap_pvt_sasl_install
\n
"
,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_pvt_sasl_install
\n
"
,
0
,
0
,
0
);
...
...
@@ -457,8 +457,8 @@ ldap_int_sasl_open(
}
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cyrus"
,
LDAP_LEVEL_DETAIL1
,
"ldap_int_sasl_open: host=%s
\n
"
,
host
)
);
LDAP_LOG
(
TRANSPORT
,
DETAIL1
,
"ldap_int_sasl_open: host=%s
\n
"
,
host
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_int_sasl_open: host=%s
\n
"
,
host
,
0
,
0
);
...
...
@@ -479,8 +479,8 @@ ldap_int_sasl_open(
(
void
*
)
&
extprops
);
#endif
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cyrus"
,
LDAP_LEVEL_
DETAIL1
,
"ldap_int_sasl_open: ssf=%ld
\n
"
,
(
long
)
ssf
)
);
LDAP_LOG
(
TRANSPORT
,
DETAIL1
,
"ldap_int_sasl_open: ssf=%ld
\n
"
,
(
long
)
ssf
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_int_sasl_open: ssf=%ld
\n
"
,
(
long
)
ssf
,
0
,
0
);
...
...
@@ -525,8 +525,8 @@ ldap_int_sasl_bind(
ber_socket_t
sd
;
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cyrus"
,
LDAP_LEVEL_ARGS
,
"ldap_int_sasl_bind: %s
\n
"
,
mechs
?
mechs
:
"<null>"
)
);
LDAP_LOG
(
TRANSPORT
,
ARGS
,
"ldap_int_sasl_bind: %s
\n
"
,
mechs
?
mechs
:
"<null>"
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_int_sasl_bind: %s
\n
"
,
mechs
?
mechs
:
"<null>"
,
0
,
0
);
...
...
@@ -637,9 +637,9 @@ ldap_int_sasl_bind(
if
(
scred
&&
scred
->
bv_len
)
{
/* and server provided us with data? */
#ifdef NEW_LOGGING
LDAP_LOG
(
(
"cyrus"
,
LDAP_LEVEL_
DETAIL1
,
LDAP_LOG
(
TRANSPORT
,
DETAIL1
,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld
\n
"
,
rc
,
saslrc
,
scred
->
bv_len
)
);
rc
,
saslrc
,
scred
->
bv_len
);