mysql: decrease package number
[openwrt/svn-archive/archive.git] / libs / openldap / patches / 010-fix-asserts.patch
1 diff -u --recursive openldap-2.4.19-vanilla/servers/slapd/connection.c openldap-2.4.19/servers/slapd/connection.c
2 --- openldap-2.4.19-vanilla/servers/slapd/connection.c 2009-11-17 19:04:26.000000000 -0500
3 +++ openldap-2.4.19/servers/slapd/connection.c 2009-11-17 19:09:02.000000000 -0500
4 @@ -783,7 +783,9 @@
5 {
6 assert( connections != NULL );
7 assert( c != NULL );
8 - assert( c->c_struct_state == SLAP_C_USED );
9 +
10 + if ( c->c_struct_state != SLAP_C_USED ) return;
11 +
12 assert( c->c_conn_state != SLAP_C_INVALID );
13
14 /* c_mutex must be locked by caller */
15 @@ -816,7 +818,9 @@
16 {
17 assert( connections != NULL );
18 assert( c != NULL );
19 - assert( c->c_struct_state == SLAP_C_USED );
20 +
21 + if ( c->c_struct_state != SLAP_C_USED ) return;
22 +
23 assert( c->c_conn_state == SLAP_C_CLOSING );
24
25 /* NOTE: c_mutex should be locked by caller */
26 diff -u --recursive openldap-2.4.19-vanilla/servers/slapd/daemon.c openldap-2.4.19/servers/slapd/daemon.c
27 --- openldap-2.4.19-vanilla/servers/slapd/daemon.c 2009-11-17 19:04:26.000000000 -0500
28 +++ openldap-2.4.19/servers/slapd/daemon.c 2009-11-17 19:10:54.000000000 -0500
29 @@ -989,13 +989,17 @@
30 void
31 slapd_set_read( ber_socket_t s, int wake )
32 {
33 + int do_wake = 1;
34 ldap_pvt_thread_mutex_lock( &slap_daemon.sd_mutex );
35
36 - assert( SLAP_SOCK_IS_ACTIVE( s ));
37 - if (!SLAP_SOCK_IS_READ( s )) SLAP_SOCK_SET_READ( s );
38 -
39 + if( SLAP_SOCK_IS_ACTIVE( s ) && !SLAP_SOCK_IS_READ( s )) {
40 + SLAP_SOCK_SET_READ( s );
41 + } else {
42 + do_wake = 0;
43 + }
44 ldap_pvt_thread_mutex_unlock( &slap_daemon.sd_mutex );
45 - WAKE_LISTENER(wake);
46 + if ( do_wake )
47 + WAKE_LISTENER(wake);
48 }
49
50 time_t