bool verify_pcontext;
bool first_pdu_done;
bool incomplete_request_data;
+ bool incomplete_payload;
bool last_pdu_done;
struct {
if (state->in_flags & LIBNDR_FLAG_INCOMPLETE_BUFFER) {
state->subreq->incomplete_request_data = true;
+ state->subreq->incomplete_payload = true;
}
return req;
req->payload.length += length;
}
- if (!(pkt->pfc_flags & DCERPC_PFC_FLAG_LAST)) {
- data_blob_free(raw_packet);
+ if (pkt->pfc_flags & DCERPC_PFC_FLAG_LAST) {
+ req->last_pdu_done = true;
+ }
+ if (!req->last_pdu_done) {
+ data_blob_free(raw_packet);
req->status = dcerpc_send_read(c);
if (!NT_STATUS_IS_OK(req->status)) {
goto req_done;
}
- if (!req->incomplete_request_data) {
+ if (!req->incomplete_payload) {
return;
}
req->p->verified_pcontext = true;
}
- req->incomplete_request_data = false;
+ req->incomplete_payload = false;
req_done:
data_blob_free(raw_packet);
}
remaining -= chunk;
-
+ req->last_pdu_done = last_frag;
}
if (req->request_data_allocated) {
req->request_data_allocated = false;
req->request_data = data_blob_null;
- if (!req->incomplete_request_data) {
+ if (req->last_pdu_done) {
DLIST_REMOVE(c->request_queue, req);
DLIST_ADD(c->pending, req);
req->state = RPC_REQUEST_PENDING;
/*
- * we reuse first_pdu_done for the receive side
+ * we reuse *_pdu_done for the receive side
*/
req->first_pdu_done = false;
+ req->last_pdu_done = false;
}
- if (req->stub_subreq == NULL) {
- return;
- }
-
- tevent_req_done(req->stub_subreq);
+ if (req->stub_subreq == NULL) {
return;
}
+ tevent_req_done(req->stub_subreq);
+ return;
}
static void dcerpc_io_trigger(struct tevent_context *ctx,