dbwrap: add enum dbwrap_req_state
commit27acbb26ee7ae8d4f475ed742fb28ada84f24cc1
authorRalph Boehme <slow@samba.org>
Tue, 10 Jan 2017 13:22:21 +0000 (10 14:22 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 18 Apr 2017 20:54:16 +0000 (18 22:54 +0200)
tree37a7c98bbdef799c0622c9be2ffcf75b475bbe91
parent1fcb66efe0530593cc31a3f64a96fc5ca543fcc3
dbwrap: add enum dbwrap_req_state

This will be used by async dwrap_parse_send() as an out argument, giving
the caller an indication about the state of the request.

This is can be useful for the caller if it is a sync function and sends
multiple async dbwrap requests. As it's a sync function it won't return
to the main tevent event loop and so the async dbwrap recv function are
not called.

As a result the function may deadlock: our receive queue may already be
full with results from a peer, the peer might be blocked in his send
queue (because we're not receiving), the peer therefor doesn't read from
his receive queue so our send queue will block as well.

To inform the caller of this situation "send queue full" we return this
state information to the caller of the dbwrap send function.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/dbwrap/dbwrap.h