File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1818 connections should require the server hostname to match the hostname
1919 specified in the SSL cert. By default 'ssl_check_hostname' is False
2020 for backwards compatibility. #1196
21+ * Slightly optimized command packing. Thanks @Deneby67. #1255
2122* 3.3.11
2223 * Further fix for the SSLError -> TimeoutError mapping to work
2324 on obscure releases of Python 2.7.
Original file line number Diff line number Diff line change @@ -757,15 +757,16 @@ def pack_command(self, *args):
757757 for arg in imap (self .encoder .encode , args ):
758758 # to avoid large string mallocs, chunk the command into the
759759 # output list if we're sending large values
760- if len (buff ) > buffer_cutoff or len (arg ) > buffer_cutoff :
760+ arg_length = len (arg )
761+ if len (buff ) > buffer_cutoff or arg_length > buffer_cutoff :
761762 buff = SYM_EMPTY .join (
762- (buff , SYM_DOLLAR , str (len ( arg ) ).encode (), SYM_CRLF ))
763+ (buff , SYM_DOLLAR , str (arg_length ).encode (), SYM_CRLF ))
763764 output .append (buff )
764765 output .append (arg )
765766 buff = SYM_CRLF
766767 else :
767768 buff = SYM_EMPTY .join (
768- (buff , SYM_DOLLAR , str (len ( arg ) ).encode (),
769+ (buff , SYM_DOLLAR , str (arg_length ).encode (),
769770 SYM_CRLF , arg , SYM_CRLF ))
770771 output .append (buff )
771772 return output
You can’t perform that action at this time.
0 commit comments