I'm trying to write a program that listens to a server via Syncrepl. I'm working from RFC4533, man ldap_sync, and reading ldap_sync.c I'm running the library with the trace messages defined back in.
As far as I understand it, the server is required to send SearchResultEntry messages with the appropriate control. But when and how do I find these messages? I've tried these variants: ldap_sync_init_refresh_and_persist(&sfrotz); while(1) { printf("Sync code:%d\n", ldap_sync_poll(&sfrotz)); sleep(7); }
vs
while(1) { printf("Sync code:%d\n", ldap_sync_init_refresh_only(&sfrotz)); sleep(7); }
Both start of well, by giving me a SearchResultEntry message for each DN. But then, as I add or delete entries, I don't get any more SearchResultEntry messages. With the refresh_only variant, I get intermediate when I delete entries and sometimes when I add entries (but this seems flaky). Also, with the refresh_only variant, the SearchResultDone message (that I get on every call) has a different cookie when I've added or deleted entries from my server. But where are my precious SearchResultEntry messages? I want the ls_search_entry callback to trigger! It only triggers during the first init with an empty cookie.
Please, help me! I'm going crazy! I fully acknowledge that the problem is probably something I've done wrong, but I don't understand what. I've worked full time on this issue for three weeks. I know I'm an idiot but I've tried reading the man pages, the RFC and the code. I know my future employer will find this e-mail and decline to hire me because of how stupid I come across. But I'm sending it anyway, that's how desperate I am. Thank you.
Sandra
openldap-software@openldap.org