mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
rpc_server: use the same chunk_size logic as we we use in the client
metze (This used to be commit 9ff0ce42b32bf0f1463d2cb9c2a6595f51b13d04)
This commit is contained in:
parent
d8ac9bde86
commit
8bd7dabb07
@ -886,7 +886,7 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call)
|
|||||||
struct ndr_push *push;
|
struct ndr_push *push;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
DATA_BLOB stub;
|
DATA_BLOB stub;
|
||||||
uint32_t total_length;
|
uint32_t total_length, chunk_size;
|
||||||
struct dcesrv_connection_context *context = call->context;
|
struct dcesrv_connection_context *context = call->context;
|
||||||
|
|
||||||
/* call the reply function */
|
/* call the reply function */
|
||||||
@ -917,20 +917,20 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call)
|
|||||||
|
|
||||||
total_length = stub.length;
|
total_length = stub.length;
|
||||||
|
|
||||||
|
/* we can write a full max_recv_frag size, minus the dcerpc
|
||||||
|
request header size */
|
||||||
|
chunk_size = call->conn->cli_max_recv_frag - (DCERPC_MAX_SIGN_SIZE+DCERPC_REQUEST_LENGTH);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
uint32_t length;
|
uint32_t length;
|
||||||
struct data_blob_list_item *rep;
|
struct data_blob_list_item *rep;
|
||||||
struct ncacn_packet pkt;
|
struct ncacn_packet pkt;
|
||||||
|
const uint32_t overhead = (DCERPC_MAX_SIGN_SIZE+DCERPC_RESPONSE_LENGTH);
|
||||||
|
|
||||||
rep = talloc(call, struct data_blob_list_item);
|
rep = talloc(call, struct data_blob_list_item);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(rep);
|
NT_STATUS_HAVE_NO_MEMORY(rep);
|
||||||
|
|
||||||
length = stub.length;
|
length = MIN(chunk_size, stub.length);
|
||||||
if (length + DCERPC_RESPONSE_LENGTH > call->conn->cli_max_recv_frag) {
|
|
||||||
/* the 32 is to cope with signing data */
|
|
||||||
length = call->conn->cli_max_recv_frag -
|
|
||||||
(DCERPC_MAX_SIGN_SIZE+DCERPC_RESPONSE_LENGTH);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* form the dcerpc response packet */
|
/* form the dcerpc response packet */
|
||||||
dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
|
dcesrv_init_hdr(&pkt, lp_rpc_big_endian(call->conn->dce_ctx->lp_ctx));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user