1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Add cli_request->recv_helper

Necessary for requests with multiple replies
(This used to be commit cb2e338eb3)
This commit is contained in:
Volker Lendecke 2008-08-27 19:26:40 +02:00
parent b054f14111
commit bb0fc9cfce
2 changed files with 18 additions and 1 deletions

View File

@ -91,6 +91,18 @@ struct cli_request {
uint8_t *rcvbuf;
} read;
} data;
/**
* For requests that don't follow the strict request/reply pattern
* such as the transaction request family and echo requests it is
* necessary to break the standard procedure in
* handle_incoming_pdu(). For a simple example look at
* cli_echo_recv_helper().
*/
struct {
void (*fn)(struct async_req *req);
void *priv;
} recv_helper;
};
/*

View File

@ -409,6 +409,7 @@ bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
req->async = NULL;
req->enc_state = NULL;
req->recv_helper.fn = NULL;
SSVAL(req->outbuf, smb_tid, cli->cnum);
cli_setup_packet_buf(cli, req->outbuf);
@ -822,7 +823,11 @@ static void handle_incoming_pdu(struct cli_state *cli)
* destructor cli_async_req_destructor().
*/
if (req->async[i] != NULL) {
async_req_done(req->async[i]);
if (req->recv_helper.fn != NULL) {
req->recv_helper.fn(req->async[i]);
} else {
async_req_done(req->async[i]);
}
}
}
return;