vanrein / lillydap

LillyDAP == Little LDAP: Event-driven, lock-free kernel for dynamic data servers, clients, filters, ...
Other
8 stars 2 forks source link

Add support for retrieval from LDAPresult messages #6

Closed vanrein closed 7 years ago

vanrein commented 7 years ago

The simplest result messages contain a result code and/or a string. Optionally, there could be more.

It would be ideal if these could be retrieved from a response message in a generic manner. Especially when passing requests to a server, it is useful to be able to learn easily what it has said.

Similarly, the ability to build such responses through generic support is welcome, because many commands do not require additional data anyway.

vanrein commented 7 years ago

One way of doing this is by side-channeling responses to lillyget_response() and lillyput_response(). This would simplify both processing responses and generating them, just as planned above. Moreover, it would integrate nicely with the API above.

The question that remains is when to invoke lillyget_operation() with a more-than-average result. This may be the decision of the configuration, and could possibly be made specifically for an operation code. Whether lillyput_operation() or lillyput_response() is used is a much easier choice; the application simply does what it likes.

We should put some thought into the ordering of the API calls, for sure, but it does seem to make sense to add response handling with a possibly different treatment.

vanrein commented 7 years ago

Done in 0f01cdd11d82652d9e7c3d956a62ef2dd56778fc