[Date Prev][Date Next] [Chronological] [Thread] [Top]

Resend, slapd daemon.c error



Resend I missed some things,

 Hello again,

	I tracked down this error (below)
	Basically when one thread is in the process of doing the
	unbind, the main thread sees activity on the fd.  So I
	added the following code to daemon.c . 

	Although the error probably does not cause any real damage.
	I prefer to not see any, since it makes it eaiser when tracking
	down real problems.

	Questions
	1) Can I assume that c[i].c_ops[0].o_tag be unbind? Are all
operations
		removed from the list until the last one left is the
unbind?

	2) Should the writewaiter be blocked also?


	Bob Rothlisberger
	rwroth@netdox.com

//  daemon.c Line 177 (1.1.3)
//  Do not cal FD_SET if the the last operation was an unbind.

    for ( i = 0; i < dtblsize; i++ ) {
         if ( c[i].c_sb.sb_sd != -1 ) {
           if ( c[i].c_ops ) {
              if ( c[i].c_ops[0].o_tag != LDAP_REQ_UNBIND &&
                   c[i].c_ops[0].o_tag != LDAP_REQ_UNBIND_30 ) {

                         FD_SET( c[i].c_sb.sb_sd, &readfds );
			}
			// Do not set bit if we are in the process of
unbinding
		}
            else
               FD_SET( c[i].c_sb.sb_sd, &readfds );

            if ( c[i].c_writewaiter ) {
               FD_SET( c[i].c_sb.sb_sd, &writefds );
            }
            Debug( LDAP_DEBUG_CONNS, " %dr%s", i,
                c[i].c_writewaiter ? "w" : "", 0 );
         }



send_ldap_result 68::
ber_flush: 14 bytes to sd 5
         0 0c 02 01 02  i 07 0a 01  D 04 00 04 00 
conn=0 op=1 RESULT err=68 tag=105 nentries=0
select activity on 1 descriptors
activity on: 5r
read activity on 5
ber_get_next
ber_get_next: tag 0x30 len 5 contents:
ber_dump: buf 0x5bad8, ptr 0x5bad8, end 0x5badd
          current len 5, contents:
        02 01 03  B 00 
do_unbind
conn=0 op=2 UNBIND
listening for connections on 3, activity on: 5r
before select active_threads 1
select activity on 1 descriptors
conn=0 op=2 fd=5 closed errno=0
activity on: 5r
read activity on 5
ber_get_next
ber_get_next on fd -1 failed errno 9 (Bad file number)
*** got 0 of 0 so far
listening for connections on 3, activity on:
before select active_threads 0