correctly handle CONNECT with zero-length client_id

Zero-length client_ids in CONNECT packets show up in the payload as empty strings, not None; the broker should generate a new id for these connections.
pull/8/head
Adam Mayer 2018-03-14 13:21:17 -04:00 zatwierdzone przez GitHub
rodzic 031580a3fc
commit bbcf7b3849
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -370,7 +370,7 @@ class Broker:
if client_session.clean_session:
# Delete existing session and create a new one
if client_session.client_id is not None:
if client_session.client_id is not None and client_session.client_id != "":
self.delete_session(client_session.client_id)
else:
client_session.client_id = gen_client_id()