summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_dual.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-06-20 13:42:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:20 -0500
commitb62247f1eee94cadcf293084ce747c4b58aa1ac5 (patch)
tree9c32eda3836675166c7d791cfcef365d99dec5ce /source3/nsswitch/winbindd_dual.c
parente6ef7ba7a4bc79dbc98119abc5cb9bd72d43c2a4 (diff)
downloadsamba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.tar.gz
samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.tar.bz2
samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.zip
r7785: This looks much larger than it is. It changes the top-level functions of the
parent winbind not to return winbindd_result. This is to hopefully fix all the problems where a result has been scheduled for write twice. The problematic ones have been the functions that might have been delayed as well as under other circumstances immediately gets answered from the cache. Now a request needs to be explicitly replied to with a request_error() or request_ok(). Volker (This used to be commit 7365c9accf98ec1dd78a59dd7f62462bbb8528d4)
Diffstat (limited to 'source3/nsswitch/winbindd_dual.c')
-rw-r--r--source3/nsswitch/winbindd_dual.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c
index e1ed2d6763..2b0ce8c14d 100644
--- a/source3/nsswitch/winbindd_dual.c
+++ b/source3/nsswitch/winbindd_dual.c
@@ -332,6 +332,7 @@ static void async_reply_recv(void *private, BOOL success)
if (!success) {
DEBUG(5, ("Could not receive async reply\n"));
state->response->result = WINBINDD_ERROR;
+ return;
}
if (state->response->result == WINBINDD_OK)
@@ -420,6 +421,41 @@ void async_domain_request(TALLOC_CTX *mem_ctx,
init_child_connection(domain, domain_init_recv, state);
}
+static void recvfrom_child(void *private, BOOL success)
+{
+ struct winbindd_cli_state *state =
+ talloc_get_type_abort(private, struct winbindd_cli_state);
+ enum winbindd_result result = state->response.result;
+
+ /* This is an optimization: The child has written directly to the
+ * response buffer. The request itself is still in pending state,
+ * state that in the result code. */
+
+ state->response.result = WINBINDD_PENDING;
+
+ if ((!success) || (result != WINBINDD_OK)) {
+ request_error(state);
+ return;
+ }
+
+ request_ok(state);
+}
+
+void sendto_child(struct winbindd_cli_state *state,
+ struct winbindd_child *child)
+{
+ async_request(state->mem_ctx, child, &state->request,
+ &state->response, recvfrom_child, state);
+}
+
+void sendto_domain(struct winbindd_cli_state *state,
+ struct winbindd_domain *domain)
+{
+ async_domain_request(state->mem_ctx, domain,
+ &state->request, &state->response,
+ recvfrom_child, state);
+}
+
static void domain_init_recv(void *private, BOOL success)
{
struct domain_request_state *state =