cockpit-project / console.dot

Webconsole Cloud Service
2 stars 3 forks source link

Use loop.getaddrinfo() to resolve hostnames #73

Closed tiran closed 2 years ago

tiran commented 2 years ago

handle_session_new uses socket.gethostbyname to resolve a hostname to IP address. Hostname lookup is blocking operation. The correct API is https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.getaddrinfo

martinpitt commented 2 years ago

Ooooh, nice one @tiran! This already annoyed me, but I didn't find an async replacement.