size_t oldsize, newsize;
DALLOC_CTX *d = NULL;
uint64_t *uint64p = NULL;
+ bool search_in_progress = false;
sl_cnids_t *cnids = NULL;
size_t ncnids;
size_t i;
}
if (*uint64p == 35) {
- DBG_DEBUG("search done: %s", dalloc_dump(d, 0));
- tevent_req_done(req);
- return;
+ DBG_DEBUG("Search in progress\n");
+ search_in_progress = true;
}
cnids = dalloc_get(d, "DALLOC_CTX", 0, "sl_cnids_t", 1);
}
ncnids = dalloc_size(cnids->ca_cnids);
- if (ncnids == 0) {
+ if (ncnids == 0 && !search_in_progress) {
tevent_req_nterror(req, NT_STATUS_NO_MORE_MATCHES);
return;
}
* py_dcerpc_interface_init_helper()
* -> dcerpc_pipe_connect()
*/
+again:
req = mdscli_get_results_send(frame,
pipe->ev,
search);
}
status = mdscli_get_results_recv(req, frame, &cnids);
+ TALLOC_FREE(req);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_PENDING)) {
+ sleep(1);
+ goto again;
+ }
if (!NT_STATUS_IS_OK(status) &&
!NT_STATUS_EQUAL(status, NT_STATUS_NO_MORE_MATCHES))
{
PyErr_SetNTSTATUS(status);
goto out;
}
- TALLOC_FREE(req);
result = Py_BuildValue("[]");
}
break;
}
+
+ ncnids = talloc_array_length(cnids);
+
+ if (NT_STATUS_EQUAL(status, NT_STATUS_PENDING) &&
+ ncnids == 0)
+ {
+ sleep(1);
+ continue;
+ }
if (!NT_STATUS_IS_OK(status)) {
printf("mdscli_get_results failed\n");
goto fail_free_messaging;
}
- ncnids = talloc_array_length(cnids);
if (ncnids == 0) {
break;
}