Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeout in async and sync DoH query #1155

Closed
wants to merge 1 commit into from

Conversation

mustafacco7
Copy link

@mustafacco7 mustafacco7 commented Oct 24, 2024

Fixes #978

Add timeout handling to dns.asyncquery.https function to prevent hanging on non-DoH servers.

  • Modify dns/asyncquery.py to use asyncio.wait_for in the https function to enforce the timeout.
  • Update tests/test_query.py to include a test case for the timeout behavior in dns.asyncquery.https.

For more details, open the Copilot Workspace session.

Fixes rthalley#978

Add timeout handling to `dns.asyncquery.https` function to prevent hanging on non-DoH servers.

* Modify `dns/asyncquery.py` to use `asyncio.wait_for` in the `https` function to enforce the timeout.
* Update `tests/test_query.py` to include a test case for the timeout behavior in `dns.asyncquery.https`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/rthalley/dnspython/issues/978?shareId=XXXX-XXXX-XXXX-XXXX).
@rthalley rthalley closed this Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timout in async and sync DoH query
2 participants