@@ -897,6 +897,10 @@ def _connect_socket(self):
897
897
for args in self .sockopts :
898
898
self ._socket .setsockopt (* args )
899
899
900
+ def _enable_compression (self ):
901
+ if self ._compressor :
902
+ self .compressor = self ._compressor
903
+
900
904
def _enable_checksumming (self ):
901
905
self ._io_buffer .set_checksumming_buffer ()
902
906
self ._is_checksumming_enabled = True
@@ -1328,8 +1332,7 @@ def _handle_startup_response(self, startup_response, did_authenticate=False):
1328
1332
self .authenticator .__class__ .__name__ )
1329
1333
1330
1334
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 ()
1333
1336
1334
1337
if ProtocolVersion .has_checksumming_support (self .protocol_version ):
1335
1338
self ._enable_checksumming ()
@@ -1345,6 +1348,7 @@ def _handle_startup_response(self, startup_response, did_authenticate=False):
1345
1348
"if DSE authentication is configured with transitional mode" % (self .host ,))
1346
1349
raise AuthenticationFailed ('Remote end requires authentication' )
1347
1350
1351
+ self ._enable_compression ()
1348
1352
if ProtocolVersion .has_checksumming_support (self .protocol_version ):
1349
1353
self ._enable_checksumming ()
1350
1354
0 commit comments