File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -525,12 +525,13 @@ def get_buffer(self, sizehint: int) -> memoryview:
525
525
either no data remains or an empty buffer is returned.
526
526
"""
527
527
# Reuse the active buffer if it has space.
528
+ # Allocate a bit more than the max response size for an AWS KMS response.
529
+ sizehint = max (sizehint , 16384 )
528
530
if len (self ._buffers ):
529
531
buffer = self ._buffers [- 1 ]
530
532
if len (buffer .buffer ) - buffer .end_index > sizehint :
531
533
return buffer .buffer [buffer .end_index :]
532
- # Allocate a bit more than the max response size for an AWS KMS response.
533
- buffer = KMSBuffer (memoryview (bytearray (16384 )), 0 , 0 )
534
+ buffer = KMSBuffer (memoryview (bytearray (sizehint )), 0 , 0 )
534
535
self ._buffers .append (buffer )
535
536
return buffer .buffer
536
537
You can’t perform that action at this time.
0 commit comments