@@ -897,6 +897,10 @@ def _connect_socket(self):
897897 for args in self .sockopts :
898898 self ._socket .setsockopt (* args )
899899
900+ def _enable_compression (self ):
901+ if self ._compressor :
902+ self .compressor = self ._compressor
903+
900904 def _enable_checksumming (self ):
901905 self ._io_buffer .set_checksumming_buffer ()
902906 self ._is_checksumming_enabled = True
@@ -1328,8 +1332,7 @@ def _handle_startup_response(self, startup_response, did_authenticate=False):
13281332 self .authenticator .__class__ .__name__ )
13291333
13301334 log .debug ("Got ReadyMessage on new connection (%s) from %s" , id (self ), self .endpoint )
1331- if self ._compressor :
1332- self .compressor = self ._compressor
1335+ self ._enable_compression ()
13331336
13341337 if ProtocolVersion .has_checksumming_support (self .protocol_version ):
13351338 self ._enable_checksumming ()
@@ -1345,6 +1348,7 @@ def _handle_startup_response(self, startup_response, did_authenticate=False):
13451348 "if DSE authentication is configured with transitional mode" % (self .host ,))
13461349 raise AuthenticationFailed ('Remote end requires authentication' )
13471350
1351+ self ._enable_compression ()
13481352 if ProtocolVersion .has_checksumming_support (self .protocol_version ):
13491353 self ._enable_checksumming ()
13501354
0 commit comments