stop sending make_join requests after 50 failures
this is a very generous number Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
af6c72fa84
commit
a0ad911688
1 changed files with 10 additions and 0 deletions
|
@ -1169,6 +1169,7 @@ async fn make_join_request(
|
||||||
|
|
||||||
if let Err(ref e) = make_join_response {
|
if let Err(ref e) = make_join_response {
|
||||||
trace!("make_join ErrorKind string: {:?}", e.error_code().to_string());
|
trace!("make_join ErrorKind string: {:?}", e.error_code().to_string());
|
||||||
|
|
||||||
// converting to a string is necessary (i think) because ruma is forcing us to
|
// converting to a string is necessary (i think) because ruma is forcing us to
|
||||||
// fill in the struct for M_INCOMPATIBLE_ROOM_VERSION
|
// fill in the struct for M_INCOMPATIBLE_ROOM_VERSION
|
||||||
if e.error_code()
|
if e.error_code()
|
||||||
|
@ -1190,6 +1191,15 @@ async fn make_join_request(
|
||||||
Err(Error::BadServerResponse("Room version is not supported by Conduwuit"));
|
Err(Error::BadServerResponse("Room version is not supported by Conduwuit"));
|
||||||
return make_join_response_and_server;
|
return make_join_response_and_server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if make_join_counter > 50 {
|
||||||
|
warn!(
|
||||||
|
"50 servers failed to provide valid make_join response, assuming no server can assist in joining."
|
||||||
|
);
|
||||||
|
make_join_response_and_server =
|
||||||
|
Err(Error::BadServerResponse("No server available to assist in joining."));
|
||||||
|
return make_join_response_and_server;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
make_join_response_and_server = make_join_response.map(|r| (r, remote_server.clone()));
|
make_join_response_and_server = make_join_response.map(|r| (r, remote_server.clone()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue