Commit Graph

37 Commits

Author SHA1 Message Date
k3d3
de3416e260 Fix cfg for test
Fix up cfg attributes to work on an xor basis.

Previously, the cfg(any()) attributes would cause issues when
both native-tls and tls features were enabled. Now, https functions
and enum variants will only be created when tls xor native-tls are
enabled. Additionally, a compile error has been added for when
both tls and native-tls features are enabled.
2020-06-15 09:25:49 +02:00
Jacob Hoffman-Andrews
378ef57636 Fix findings from cargo clippy. 2020-06-15 09:11:43 +02:00
Jacob Hoffman-Andrews
b4c15eef2c Check for server closed connections.
This builds on 753d61b. Before we send a request, we can do a 1-byte
nonblocking peek on the connection. If the server has closed the
connection, this will give us an EOF, and we can take the connection out
of the pool before sending any request on it. This will reduce the
likelihood that we send a non-retryable POST on an already-closed
connection.

The server could still potentially close the connection between when we
make this check and when we finish sending the request, but this should
handle the majority of cases.
2020-06-15 09:11:25 +02:00
Martin Algesten
deb2002f6f port in host header. close #63 2020-06-12 22:00:30 +02:00
Martin Algesten
c5bc27260b code format 2020-05-23 09:29:57 +02:00
Martin Algesten
c281307659 fix test warning 2020-05-20 21:25:47 +02:00
Rob Young
b61991d87e Fix a couple of feature flag uses
Wrap a json doc-test in cfg block to stop in failing when tests are
run with --no-default-features
2020-05-20 20:55:19 +02:00
Rob Young
2e3a75166d Allow TLS client config to be overridden
See: https://docs.rs/rustls/latest/rustls/struct.ClientConfig.html
2020-05-20 20:54:04 +02:00
rustysec
3b0df412ef initial proxy impl 2020-03-14 09:54:54 +01:00
Martin Algesten
4b9cfe2b67 fix clippy lints 2020-01-07 07:59:29 +01:00
Tom Forbes
594340a096 Fix compilation errors with the cookies feature (#22)
* Fix compilation errors with the cookies feature
2019-10-30 11:51:06 +01:00
Martin Algesten
753d61b454 Retry some pooled connections failing when server closes. Close #10
This is not a perfect solution. It works as long as we are not sending
any body bytes. We discover the error first when attempting to read
the response status line. That means we discover the error after
sending body bytes. To be able to re-send the body, we would need to
introduce a buffer to be able to replay the body on the next
request. We don't currently do that.
2019-10-20 21:36:38 +02:00
Tom Forbes
da42f2ed8f Make cookies conditional 2019-10-20 20:17:35 +02:00
Martin Algesten
d8f8220c3c clippy fix warning 2019-10-20 11:49:20 +02:00
Martin Algesten
41b21d37e4 fix clippy warnings 2019-06-21 15:09:36 +02:00
Chris West (Faux)
ceb7c3ac14 use pub(crate) instead of include!() 2019-05-27 17:44:14 +01:00
Martin Algesten
cb3d6e8124 resolved url in response 2018-12-20 11:08:39 +01:00
Martin Algesten
07fd4d2cd5 pub(crate) where we can 2018-12-20 11:08:20 +01:00
Martin Algesten
1519dcb0b1 fix redirect logic 2018-12-20 10:54:47 +01:00
Martin Algesten
4151aab3b4 redirects 0 2018-12-18 13:34:05 +01:00
Martin Algesten
5ba6b3cd4d edition 2018, clippy, fmt 2018-12-18 13:17:19 +01:00
Martin Algesten
5a6ccfdae0 default User-Agent and Accept headers 2018-12-04 18:05:50 +01:00
Martin Algesten
9779871f53 clean up hostname confusion 2018-12-04 18:05:35 +01:00
Martin Algesten
a7f54b3647 fix redirect query parameters/hostname 2018-12-04 18:05:19 +01:00
Martin Algesten
0bf6d10816 updated deps 2018-08-03 08:24:01 +02:00
Martin Algesten
454e5a123f fix send body confusion 2018-07-03 10:54:22 +02:00
Martin Algesten
9cf33365e5 avoid panic for headers 2018-07-02 09:10:31 +02:00
Martin Algesten
51744804da avoid parsing when setting headers 2018-07-01 18:33:50 +02:00
Martin Algesten
1812b7f6b8 handle auth in url 2018-07-01 18:32:00 +02:00
Martin Algesten
2d2daf58ba doc 2018-07-01 11:13:21 +02:00
Martin Algesten
4a5944443f connection pooling 2018-06-30 16:52:54 +02:00
Martin Algesten
317f75f8bf set unit on response 2018-06-30 14:37:48 +02:00
Martin Algesten
54558fbb26 refactor to body 2018-06-30 14:11:54 +02:00
Martin Algesten
0e4c326caf tidy 2018-06-30 14:01:13 +02:00
Martin Algesten
ff582b8c6f separate out stream 2018-06-30 13:47:37 +02:00
Martin Algesten
b54f747d16 separate out response 2018-06-30 13:36:41 +02:00
Martin Algesten
f5a4c83819 refactor into unit 2018-06-30 13:05:36 +02:00