Mozilla LDAP C-SDK 5.0 has two for-loops in wait4msg() in result.c. QUESTION: What's the job of the read1msg() in the first...and the second for-loop?
BACKGROUND: 1. The first one calls read1msg() without waiting for a poll. It does a quick msgid match to find relevant messages before processing it with read1msg(). 2. The second for-loop appears to call read1msg() after waiting for a poll and calls read1msg() again and again if read1msg() wasn't able to retreive anything meaningful. It seems the second read1msg() can loop to interperate all messages in a list of messages when the LDAP directory server decides to send partial results at a time (one referral at a time.) Is this accurate? What about the if-else statement following this read1msg() that didn't exist in the first one? Why is there no msgid matching like in the first one? WHAT BROUGHT THIS UP: When testing with multiple referrals, I'm experiencing some message loss so the client ends up not following all the referalls the LDAP directory server instructs it. I suspect the SDK may be interprating end-of-messages messages too early. But I'm not familiar with the code to determine this yet. There most certainly seems to be a bug in the SDK but I don't want to jump the gun. --- Sherman Wu
