File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
bindings/matrix-sdk-ffi/src Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,11 @@ pub struct ClientBuilder {
133133 threads_enabled : bool ,
134134}
135135
136+ /// The timeout applies to each read operation, and resets after a successful
137+ /// read. This is more appropriate for detecting stalled connections when the
138+ /// size isn’t known beforehand.
139+ const DEFAULT_READ_TIMEOUT : Duration = Duration :: from_secs ( 60 ) ;
140+
136141#[ matrix_sdk_ffi_macros:: export]
137142impl ClientBuilder {
138143 #[ uniffi:: constructor]
@@ -539,6 +544,7 @@ impl ClientBuilder {
539544 if let Some ( timeout) = config. timeout {
540545 updated_config = updated_config. timeout ( Duration :: from_millis ( timeout) ) ;
541546 }
547+ updated_config = updated_config. read_timeout ( DEFAULT_READ_TIMEOUT ) ;
542548 if let Some ( max_concurrent_requests) = config. max_concurrent_requests {
543549 if max_concurrent_requests > 0 {
544550 updated_config = updated_config. max_concurrent_requests ( NonZeroUsize :: new (
You can’t perform that action at this time.
0 commit comments