Skip to content

Commit 4213d53

Browse files
authored
Fix more gssapi errors (dpkp#1280)
1 parent e06af53 commit 4213d53

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kafka/conn.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,9 @@ def _try_authenticate_gssapi(self, future):
561561
# calculate an output token from kafka token (or None if first iteration)
562562
output_token = client_ctx.step(received_token)
563563

564+
if output_token is None:
565+
continue
566+
564567
# pass output token to kafka
565568
try:
566569
msg = output_token
@@ -572,7 +575,7 @@ def _try_authenticate_gssapi(self, future):
572575
# The gssapi will be able to identify the needed next step.
573576
# The connection is closed on failure.
574577
header = self._recv_bytes_blocking(4)
575-
token_size = struct.unpack('>i', header)
578+
(token_size,) = struct.unpack('>i', header)
576579
received_token = self._recv_bytes_blocking(token_size)
577580

578581
except ConnectionError as e:

0 commit comments

Comments
 (0)