diff options
author | Andrew Bartlett <abartlet@samba.org> | 2023-05-01 14:30:31 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-05-05 02:54:30 +0000 |
commit | 963688b3a5acbf0714377b4b17e5cbbbd31e50d9 (patch) | |
tree | ce64bf95f1bb0934902eec35b87871235d207fd0 /pidl | |
parent | ff2de50aa4bf086880ab8cd1c2aee7e998c2c22a (diff) | |
download | samba-963688b3a5acbf0714377b4b17e5cbbbd31e50d9.tar.gz |
librpc: Always call ndr_push_compression_state_init() for compression
This allows the push routine to cache the chosen compression algorithm in
the struct ndr_compression_state in ndr->cstate and so, in claims, avoid
calling ndr_size_CLAIMS_SET_NDR() three times per compression (more in the
overall push).
As claims is now the primary use of the libndr compression code, this is
a reasonable tradeoff compared to the other callers who have more static
algorithm selections.
By removing the struct ndr_compression_state **state argument from
ndr_push_compression_state_init() we make clear that the ndr->cstate
belongs to this NDR context, and this context alone.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index b21a6e6513e..f468af54eb6 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -514,8 +514,8 @@ sub ParseCompressionPushStart($$$$$) $self->pidl("{"); $self->indent; $self->pidl("struct ndr_push *$comndr;"); - $self->pidl("NDR_CHECK(ndr_push_compression_state_init($ndr, $alg, &$ndr->cstate));"); - $self->pidl("NDR_CHECK(ndr_push_compression_start($ndr, &$comndr, $alg));"); + $self->pidl("NDR_CHECK(ndr_push_compression_state_init($ndr, $alg));"); + $self->pidl("NDR_CHECK(ndr_push_compression_start($ndr, &$comndr));"); return $comndr; } @@ -526,7 +526,7 @@ sub ParseCompressionPushEnd($$$$$) my $comndr = "$ndr\_compressed"; my $alg = compression_alg($e, $l, $env); - $self->pidl("NDR_CHECK(ndr_push_compression_end($ndr, $comndr, $alg));"); + $self->pidl("NDR_CHECK(ndr_push_compression_end($ndr, $comndr));"); $self->pidl("TALLOC_FREE($ndr->cstate);"); $self->deindent; $self->pidl("}"); |