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

Increase the maximum number of concurrent DNS queries from 32 to 256 (3.x) #59520

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/io/ip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ IP::ResolverID IP::resolve_hostname_queue_item(const String &p_hostname, IP::Typ
}

IP::ResolverStatus IP::get_resolve_item_status(ResolverID p_id) const {
ERR_FAIL_INDEX_V(p_id, IP::RESOLVER_MAX_QUERIES, IP::RESOLVER_STATUS_NONE);
ERR_FAIL_INDEX_V_MSG(p_id, IP::RESOLVER_MAX_QUERIES, IP::RESOLVER_STATUS_NONE, vformat("Too many concurrent DNS resolver queries (%d, but should be %d at most). Try performing less network requests at once.", p_id, IP::RESOLVER_MAX_QUERIES));

IP::ResolverStatus res = resolver->queue[p_id].status.get();
if (res == IP::RESOLVER_STATUS_NONE) {
Expand All @@ -195,7 +195,7 @@ IP::ResolverStatus IP::get_resolve_item_status(ResolverID p_id) const {
}

IP_Address IP::get_resolve_item_address(ResolverID p_id) const {
ERR_FAIL_INDEX_V(p_id, IP::RESOLVER_MAX_QUERIES, IP_Address());
ERR_FAIL_INDEX_V_MSG(p_id, IP::RESOLVER_MAX_QUERIES, IP_Address(), vformat("Too many concurrent DNS resolver queries (%d, but should be %d at most). Try performing less network requests at once.", p_id, IP::RESOLVER_MAX_QUERIES));

MutexLock lock(resolver->mutex);

Expand All @@ -215,7 +215,7 @@ IP_Address IP::get_resolve_item_address(ResolverID p_id) const {
}

Array IP::get_resolve_item_addresses(ResolverID p_id) const {
ERR_FAIL_INDEX_V(p_id, IP::RESOLVER_MAX_QUERIES, Array());
ERR_FAIL_INDEX_V_MSG(p_id, IP::RESOLVER_MAX_QUERIES, Array(), vformat("Too many concurrent DNS resolver queries (%d, but should be %d at most). Try performing less network requests at once.", p_id, IP::RESOLVER_MAX_QUERIES));

MutexLock lock(resolver->mutex);

Expand All @@ -236,7 +236,7 @@ Array IP::get_resolve_item_addresses(ResolverID p_id) const {
}

void IP::erase_resolve_item(ResolverID p_id) {
ERR_FAIL_INDEX(p_id, IP::RESOLVER_MAX_QUERIES);
ERR_FAIL_INDEX_MSG(p_id, IP::RESOLVER_MAX_QUERIES, vformat("Too many concurrent DNS resolver queries (%d, but should be %d at most). Try performing less network requests at once.", p_id, IP::RESOLVER_MAX_QUERIES));

resolver->queue[p_id].status.set(IP::RESOLVER_STATUS_NONE);
}
Expand Down
2 changes: 1 addition & 1 deletion core/io/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class IP : public Object {
};

enum {
RESOLVER_MAX_QUERIES = 32,
RESOLVER_MAX_QUERIES = 256,
RESOLVER_INVALID_ID = -1
};

Expand Down
2 changes: 1 addition & 1 deletion doc/classes/IP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<constant name="RESOLVER_STATUS_ERROR" value="3" enum="ResolverStatus">
DNS hostname resolver status: Error.
</constant>
<constant name="RESOLVER_MAX_QUERIES" value="32">
<constant name="RESOLVER_MAX_QUERIES" value="256">
Maximum number of concurrent DNS resolver queries allowed, [constant RESOLVER_INVALID_ID] is returned if exceeded.
</constant>
<constant name="RESOLVER_INVALID_ID" value="-1">
Expand Down