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:
525525 either no data remains or an empty buffer is returned.
526526 """
527527 # 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 )
528530 if len (self ._buffers ):
529531 buffer = self ._buffers [- 1 ]
530532 if len (buffer .buffer ) - buffer .end_index > sizehint :
531533 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 )
534535 self ._buffers .append (buffer )
535536 return buffer .buffer
536537
You can’t perform that action at this time.
0 commit comments