Skip to content

Commit f85d304

Browse files
Retengartmissytake
authored andcommitted
fix: add 5s timeout to TURN credential socket
Hung TURN daemon would block dict proxy handler thread indefinitely. Per Python docs, settimeout() raises TimeoutError on expiry.
1 parent 4d1856d commit f85d304

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

chatmaild/src/chatmaild/turnserver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
def turn_credentials() -> str:
66
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as client_socket:
7+
client_socket.settimeout(5)
78
client_socket.connect("/run/chatmail-turn/turn.socket")
89
with client_socket.makefile("rb") as file:
910
return file.readline().decode("utf-8").strip()

0 commit comments

Comments
 (0)