[Date Prev][Date Next]
Re: Bugfix: wait4msg() hangs when using SSL/TLS (ITS#446)
I've experimented with this patch a bit (without TLS) and found
that it causes test009-referral to hang. ldapsearch has data
pending from the master but is blocked reading from the slave.
#0 0x18183f44 in read () from /usr/lib/libc.so.3
#1 0x805a3d5 in stream_read (sb=0x806a000, buf=0x806718c, len=1)
#2 0x8059df3 in ber_pvt_sb_read (sb=0x806a000, buf_arg=0x806718c, len=1)
#3 0x8058b6b in ber_get_next (sb=0x806a000, len=0xbfbfcb70, ber=0x8067180)
#4 0x804ca47 in try_read1msg (ld=0x806a000, msgid=-1, all=1, sb=0x806a000,
#5 0x804c890 in wait4msg (ld=0x806a000, msgid=-1, all=1, timeout=0x0,
result=0xbfbfcc34) at ../../../libraries/libldap/result.c:208
#6 0x804c714 in ldap_result (ld=0x806a000, msgid=-1, all=1, timeout=0x0,
result=0xbfbfcc34) at ../../../libraries/libldap/result.c:137
#7 0x804aef7 in dosearch (ld=0x806a000,
base=0x8061040 "o=University of Michigan, c=US", scope=2, attrs=0x0,
attrsonly=0, filtpatt=0x0, value=0x8062050 "sn=jensen")
#8 0x804acfb in main (argc=11, argv=0xbfbfd4e8)
#9 0x804a095 in _start ()
At 05:42 AM 2/8/00 GMT, firstname.lastname@example.org wrote:
>Full_Name: Andrew Hacking
>Submission from: (NULL) (184.108.40.206)
>Sorry for the re-post, my email address was changed today...
>libldap wait4msg() hangs under various conditions when using SSL/TLS.
>The specifics are that wait4msg blocks in do_ldap_select()
>while waiting for data that has _already_ been buffered by the
>OpenSSL library. do_ldap_select() should never be called until
>the SSL/TLS buffers have been exhausted.
>The patch changes to wait4msg() changes the way messages are read to ensure the
>SSL/TLS buffers really are exhausted before calling do_ldap_select()
>try_read1msg() is also changed to return 'exhausted' (-3) on an
>EWOULDBLOCK/EAGAIN condition. This differentiates EWOULDBLOCK/EAGAIN
>(ie the underlying sockbuf is now exhausted) with the 'keep looking' (-2)