Commit Graph

39 Commits (e18f248dbb1f8f0a5aead28c76632cdc43d4f1fe)

Author SHA1 Message Date
Johannes Becker aaa17535ac matrix_sdk: Fix typo 2021-05-25 10:05:51 +02:00
timorl ded5830deb Make client use .well-known redirects
Was supposed to fix #219, but apparently that was about something else.
2021-05-24 11:00:42 +02:00
Devin Ragotzy 5f09d091cb Add cargo fmt to ci using nightly 2021-05-12 15:38:59 -04:00
Devin Ragotzy 2ef0c2959c Add use_small_heuristics option and run fmt 2021-05-12 15:37:29 -04:00
Devin Ragotzy c85f4d4f0c Add rustfmt config file and run over workspace 2021-05-12 15:36:52 -04:00
Johannes Becker 3b24d33822 appservice: Rely on cfg-toggle in send_request 2021-05-10 07:56:00 +02:00
Johannes Becker eece920953 appservice: Initial version 2021-05-10 07:51:52 +02:00
Jonas Platte bd02ff901f Avoid needless copies by changing http::Request<Vec<u8>> to http::Request<Bytes> 2021-04-26 17:31:27 +02:00
Johannes Becker 242d46c9a1 matrix-sdk: require_auth_for_profile_requests feature and force_auth request config
forces authentication for `get_avatar` which was previously done with
the unstable-synapse-quirks feature in ruma
2021-04-26 17:31:25 +02:00
Johannes Becker 5c882f89e8 chore: bump ruma 2021-04-26 08:05:58 +02:00
Johannes Becker 95421f1713 matrix-sdk!: send_request returns Bytes
Prevents unnecessary copy
2021-04-19 12:26:10 +02:00
Johannes Becker 3414a59b91 chore: bump ruma 2021-04-16 12:45:21 +02:00
Julian Sparber b5de203499 matrix-sdk: Add RequestConfig that replaces timeout for requests
This exposes the retry behavior to the developer. This way the user can
set if a request should be retried or failed immidiatly.

This also make sure that the timeout set by the user is used for all
requests. Of-course it can't be used for uploaded and syncs with
timeout, but this doesn't change the behavior for those requests.
2021-04-07 10:35:31 +02:00
Damir Jelić 3a08f0c278 matrix-sdk: Don't set the content type ourselves
We don't need to worry about this anymore, since Ruma sets this for all
the request nowadays.
2021-03-01 20:12:38 +01:00
Damir Jelić 4c3cd29224 matrix-sdk: Don't set two content-type headers for json contents
Ruma will for some requests already set the content-type for us to
application/json, but for some it still seems to miss the header, since
the headers are kept in a map add the header only if it isn't already
there.
2021-03-01 16:37:56 +01:00
Damir Jelić 36e3039d73 matrix-sdk: Disable request retrying for wasm for now
Backoff supports the retry method for futures only for non-wasm
targets for now, thus we're going to disable it until that changes.
2021-02-07 12:53:06 +01:00
Damir Jelić f3d4f6aab4 matrix-sdk: Fix our HttpClient trait implementation example 2021-02-01 19:24:29 +01:00
Damir Jelić 19e9884963 matrix-sdk: Update for the latest backoff changes 2021-02-01 17:58:03 +01:00
Damir Jelić a551ae2bee matrix-sdk: Add sensible connection and request timeouts
This sets the default
    * connection timeout to 5s
    * request timeout to 10s
    * request timeout for syncs to the sync timeout + 10s
    * request timeout for uploads to be based on 1Mbps upload
    speed expectations
2021-02-01 17:15:29 +01:00
Damir Jelić 6a4ac8f361 matrix-sdk: Replace some unwraps with expects. 2021-01-31 21:12:00 +01:00
Damir Jelić 42ec456abf matrix-sdk: Add initial support for request retrying 2021-01-31 21:10:30 +01:00
Damir Jelić 585ca9fdf7 matrix-sdk: Split out the http errors into a sub-enum 2021-01-31 18:09:03 +01:00
Damir Jelić 9c98d0227b matrix-sdk: Make the http client trait WASM compatible 2021-01-22 18:12:46 +01:00
Damir Jelić 4c6c1d2107 matrix-sdk: Get rid of the common macros crate
This crate was used to support different trait bounds on WASM vs other
targets, since we only define async traits in a couple of places having
a whole crate to support this feels a bit excessive.

This patch defines a target specific super trait instead, this lowers
the compile time a couple of seconds.
2021-01-04 16:34:14 +01:00
Alejandro Domínguez b58d88e0c3 Upgrade ruma 2020-10-01 11:23:26 +02:00
Damir Jelić c500c06e4b matrix-sdk: Add docs and cleanup the media upload methods. 2020-09-15 17:16:16 +02:00
Damir Jelić 7a418ae09e matrix-sdk: Implement the HttpSend trait directly on the reqwest client. 2020-08-26 14:37:48 +02:00
Damir Jelić ea4befabd9 matrix-sdk: Fix the incorrect return value of the HttpSend trait.
The HttpSend trait incorrectly returns a reqwest::Response, we already
have logic to return the response into a http::Response and we need to
do the conversion since there is no other way to build Ruma responses.
2020-08-26 13:41:15 +02:00
Damir Jelić 9e609a0fdf matrix-sdk: Move the session into the http client wrapper. 2020-08-17 15:29:07 +02:00
Jonas Platte 5040be042f
Update ruma 2020-08-15 15:17:27 +02:00
Damir Jelić 9a325a4505 matrix-sdk: Move the HttpSend trait into the http_client file. 2020-08-11 17:25:33 +02:00
Devin Ragotzy 9234ac96e1 matrix_sdk: Use our version of the async_trait macro 2020-08-11 09:17:18 -04:00
Devin Ragotzy 9294280dc1 matrix_sdk: Add DefaultHttpClient and impl HttpSend 2020-08-11 08:07:45 -04:00
Jonas Platte d83fc971ce
Update ruma 2020-08-10 13:58:39 +02:00
Jonas Platte 279e88d9f9
Fix handling of headers in HttpClient 2020-08-08 12:23:43 +02:00
Jonas Platte 591388d13e
Upgrade ruma 2020-08-05 18:00:45 +02:00
Damir Jelić 2bf8c99dfe Merge branch 'master' into sas-verification 2020-08-04 11:23:24 +02:00
Damir Jelić 2b124d98bc matrix-sdk: Pass the rwlock to the http client when doing requests. 2020-07-29 13:50:01 +02:00
Damir Jelić 27f918e52d matris-sdk: Move the http request sending logic into a separate struct. 2020-07-29 10:56:18 +02:00