klippy_connection: log raw peercred data on error
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
0a0993f9e0
commit
835e49c10e
|
@ -233,13 +233,16 @@ class KlippyConnection:
|
|||
"Unable to get Unix Socket, cant fetch peer credentials"
|
||||
)
|
||||
return
|
||||
data: bytes = b""
|
||||
try:
|
||||
data = sock.getsockopt(socket.SOL_SOCKET, socket.SO_PEERCRED, 12)
|
||||
pid, uid, gid = struct.unpack("@LLL", data)
|
||||
except asyncio.CancelledError:
|
||||
raise
|
||||
except Exception:
|
||||
logging.exception("Failed to get Klippy Credentials")
|
||||
logging.exception(
|
||||
f"Failed to get Klippy Peer Credentials, raw: 0x{data.hex()}"
|
||||
)
|
||||
return
|
||||
self._peer_cred = {
|
||||
"process_id": pid,
|
||||
|
|
Loading…
Reference in New Issue