summaryrefslogtreecommitdiffstats
path: root/core/io/ip.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-03-23 17:07:17 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-03-23 18:18:23 +0100
commit7d8b344f019f240cc734a0f2c67e8d445745d813 (patch)
tree20dbc1779e298fa935d39ac9f302361e991ddd2d /core/io/ip.cpp
parentd7d528c15f0e858b52bb0f510ff47e65c2341de1 (diff)
downloadredot-engine-7d8b344f019f240cc734a0f2c67e8d445745d813.tar.gz
Increase the maximum number of concurrent DNS queries from 32 to 256
This makes the following error message less likely to be printed when performing many concurrent HTTP requests: Condition ' resolving == IP::RESOLVER_INVALID_ID ' is true. returned: ERR_BUG
Diffstat (limited to 'core/io/ip.cpp')
-rw-r--r--core/io/ip.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/io/ip.cpp b/core/io/ip.cpp
index 8e0d47e762..2f88307d94 100644
--- a/core/io/ip.cpp
+++ b/core/io/ip.cpp
@@ -186,7 +186,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) {
@@ -197,7 +197,7 @@ IP::ResolverStatus IP::get_resolve_item_status(ResolverID p_id) const {
}
IPAddress IP::get_resolve_item_address(ResolverID p_id) const {
- ERR_FAIL_INDEX_V(p_id, IP::RESOLVER_MAX_QUERIES, IPAddress());
+ ERR_FAIL_INDEX_V_MSG(p_id, IP::RESOLVER_MAX_QUERIES, IPAddress(), 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);
@@ -217,7 +217,7 @@ IPAddress 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);
if (resolver->queue[p_id].status.get() != IP::RESOLVER_STATUS_DONE) {
@@ -237,7 +237,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);
}