packages/libs/openldap/patches/010-fix-asserts.patch
florian 0bf5301409 [package] openldap, update to 2.4.19, package slapd, cleanup makefile
(#6150)

git-svn-id: svn://svn.openwrt.org/openwrt/packages@18495 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-11-23 10:53:22 +00:00

51 lines
1.6 KiB
Diff

diff -u --recursive openldap-2.4.19-vanilla/servers/slapd/connection.c openldap-2.4.19/servers/slapd/connection.c
--- openldap-2.4.19-vanilla/servers/slapd/connection.c 2009-11-17 19:04:26.000000000 -0500
+++ openldap-2.4.19/servers/slapd/connection.c 2009-11-17 19:09:02.000000000 -0500
@@ -783,7 +783,9 @@
{
assert( connections != NULL );
assert( c != NULL );
- assert( c->c_struct_state == SLAP_C_USED );
+
+ if ( c->c_struct_state != SLAP_C_USED ) return;
+
assert( c->c_conn_state != SLAP_C_INVALID );
/* c_mutex must be locked by caller */
@@ -816,7 +818,9 @@
{
assert( connections != NULL );
assert( c != NULL );
- assert( c->c_struct_state == SLAP_C_USED );
+
+ if ( c->c_struct_state != SLAP_C_USED ) return;
+
assert( c->c_conn_state == SLAP_C_CLOSING );
/* NOTE: c_mutex should be locked by caller */
diff -u --recursive openldap-2.4.19-vanilla/servers/slapd/daemon.c openldap-2.4.19/servers/slapd/daemon.c
--- openldap-2.4.19-vanilla/servers/slapd/daemon.c 2009-11-17 19:04:26.000000000 -0500
+++ openldap-2.4.19/servers/slapd/daemon.c 2009-11-17 19:10:54.000000000 -0500
@@ -989,13 +989,17 @@
void
slapd_set_read( ber_socket_t s, int wake )
{
+ int do_wake = 1;
ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
- assert( SLAP_SOCK_IS_ACTIVE( s ));
- if (!SLAP_SOCK_IS_READ( s )) SLAP_SOCK_SET_READ( s );
-
+ if( SLAP_SOCK_IS_ACTIVE( s ) && !SLAP_SOCK_IS_READ( s )) {
+ SLAP_SOCK_SET_READ( s );
+ } else {
+ do_wake = 0;
+ }
ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
- WAKE_LISTENER(wake);
+ if ( do_wake )
+ WAKE_LISTENER(wake);
}
time_t