Sending Data to the Client
Sometimes you might need to communicate various information directly back to
the client. For example, you might want to do this in the following situations:
•
If you need to send a result code back to the client (for example, to report an
error or a successful result to an LDAP operation), call the
slapi_send_ldap_result()
•
If you are fulfilling a search request and need to send matching entries back to
the client, call the
•
If you need to refer the LDAP request to a different LDAP server, call the
slapi_str2filter()
For example, the following statement sends an
the client.
slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, \
"The operation was processed successfully.\n", 0, NULL );
NOTE
Determining if an Operation Was Abandoned
At any point in time, the client can choose to abandon an LDAP operation. When
writing database functions, keep in mind that you should periodically check to see
if the operation has been abandoned.
To determine if an operation has been abandoned, call
For example:
if ( slapi_op_abandoned( pb ) ) {
slapi_log_error( SLAPI_LOG_PLUGIN, "my_function",
return 1;
}
slapi_send_ldap_search_entry()
It is important that you send only one result per operation back to the
client.
"The operation was abandoned.\n" );
function.
function.
LDAP_SUCCESS
Sending Data to the Client
function for each entry.
status code back to
slapi_op_abandoned()
Chapter 5
Front-End API Functions
.
59
Need help?
Do you have a question about the NETSCAPE DIRECTORY SERVER 6.2 - PLUG-IN and is the answer not in the manual?
Questions and answers