5.3. Sending Data to the Client

Sometimes you might need to communicate various information directly to the client. This could occur in the following situations:
  • If you need to send a result code to the client (for example, to report an error or a successful result to an LDAP operation), call the slapi_send_ldap_result() function.
  • If you are fulfilling a search request and need to send matching entries to the client, call the slapi_send_ldap_search_entry() function for each entry.
  • To refer the LDAP request to a different LDAP server, call the slapi_send_ldap_referral() function.
For example, the following statement sends an LDAP_SUCCESS status code back to the client:
slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, "The operation was processed successfully.\n", 0, NULL );

Important

Ensure that you send only one result per operation to the client.