Commit Graph

1342 Commits

Author SHA1 Message Date
Sean McArthur
37ec724fd6 fix(http2): add Date header if not present for HTTP2 server responses 2018-10-08 17:52:08 -07:00
Sean McArthur
3e12bccac0 refactor(body): use fmt::Debug of Bytes for Chunk 2018-10-08 10:22:52 -07:00
Sean McArthur
5c3415d704 v0.12.11 2018-09-28 13:04:52 -07:00
Sean McArthur
efd2c281b8 refactor(client): add comments about the checkout vs connect race 2018-09-28 12:50:45 -07:00
Sean McArthur
09156a70a6 refactor(lib): remove build script features since minimum version is higher 2018-09-28 12:02:21 -07:00
Sean McArthur
b0c132023c refactor(client): change retryable request future from boxed to 'impl Future' 2018-09-28 12:01:37 -07:00
Sean McArthur
192348d7ef refactor(client): don't allocate PoolInner if pool is disabled 2018-09-28 11:13:22 -07:00
Sean McArthur
bddc2d5040 refactor(client): clarify some code in send_request 2018-09-28 10:24:19 -07:00
Sean McArthur
af23dda2e9 refactor(client): breakout checkout and connect race into separate function 2018-09-28 10:24:19 -07:00
Sean McArthur
5e159a58b4 refactor(client): breakout connect_to future into separate function 2018-09-28 10:24:19 -07:00
Sean McArthur
af5e4f3ec2 fix(client): allow calling Destination::set_host with IPv6 addresses
Closes #1661
2018-09-27 17:34:05 -07:00
Sean McArthur
5bfc110538 refactor(client): improve connect module structure 2018-09-27 14:50:11 -07:00
Sean McArthur
1370a6f8f0 fix(server): use provided executor if fallback to HTTP2 2018-09-18 15:20:28 -07:00
Sean McArthur
8f91747466 v0.12.10 2018-09-14 17:43:30 -07:00
Sean McArthur
2f19578162 test(http1): add test for when headers contain HTABs 2018-09-14 17:42:10 -07:00
Bastien Orivel
ca5e520e7a fix(http1): fix title-case option when header names have symbols
Don't eat the first character in a header name if it's not a letter. Same thing after a `-`
2018-09-14 17:30:50 -07:00
Sean McArthur
57556e6329 v0.12.9 2018-08-28 17:31:21 -07:00
Theodore Cipicchio
24f11a421d fix(http2): allow TE "trailers" request headers
The HTTP/2 spec allows TE headers in requests if the value is
"trailers". Other TE headers are still stripped.

Closes #1642
2018-08-27 10:32:53 -07:00
Sean McArthur
168c7d2155 feat(server): add Server::with_graceful_shutdown method
This adds a "combinator" method to `Server`, which accepts a user's
future to "select" on. All connections received by the `Server` will
be tracked, and if the user's future finishes, graceful shutdown will
begin.

- The listener will be closed immediately.
- The currently active connections will all be notified to start a
  graceful shutdown. For HTTP/1, that means finishing the existing
  response and using `connection: clone`. For HTTP/2, the graceful
  `GOAWAY` process is started.
- Once all active connections have terminated, the graceful future
  will return.

Closes #1575
2018-08-23 11:30:44 -07:00
Sean McArthur
a3c44ded55 feat(client): add max_idle_per_host configuration option
Setting this will cap the amount of idle connections kept around for a
specific host. This defaults to no limit (`usize::MAX`).
2018-08-22 12:28:49 -07:00
lambdasqd
1448e4067b fix(server): properly handle keep-alive for HTTP/1.0
Change behaviour of connection or server response when the request is
version 1.0 and the Connection: keep-alive header is not present.

1. If the response is also version 1.0, then connection is closed if the
server keep-alive header is not present.
2. If the response is version 1.1, then the keep-alive header is added
when downgrading to version 1.0.

Closes #1614
2018-08-15 12:10:03 -07:00
Sean McArthur
bdbaa85f41 v0.12.8 2018-08-10 14:42:27 -07:00
Sean McArthur
195fbb2a37 fix(server): coerce responses with HTTP2 version to HTTP/1.1 when protocol is 1.x 2018-08-10 13:08:08 -07:00
Sean McArthur
b459adb43a feat(server): add Builder::http1_keepalive method 2018-08-10 13:08:08 -07:00
Yusuke Sasaki
1e8cd5aaa6 chore(*): enable #[deny(warnings)] at only testing 2018-08-10 10:40:40 -07:00
Sean McArthur
0ea3b836f9 refactor(server): remove double nested listen errors in from_tcp 2018-08-08 11:23:37 -07:00
Yoshua Wuyts
bb4c5e24c8 feat(server): add Server::from_tcp constructor
Adds a constructor to build a `Server` from an `std::net::TcpListener`.

Closes #1602
2018-08-08 11:13:07 -07:00
Sean McArthur
6e8417e08f refactor(lib): use type macro to detect impl Trait 2018-08-07 21:00:02 -07:00
Niv Kaminer
9f8add6056 chore(client): place the use of new rust features behind cfg 2018-08-07 19:36:00 -07:00
Niv Kaminer
97f4243a59 refactor(headers): remove usage of deprecated ascii trait 2018-08-07 19:36:00 -07:00
Niv Kaminer
4290b8bba4 perf(client): replace usage of Box<Trait> with impl Trait 2018-08-07 19:36:00 -07:00
Sean McArthur
26f3a5ed31 feat(server): add remote_addr method to AddrStream 2018-08-07 16:46:46 -07:00
Laurentiu Nicola
c837fb9c29 refactor(lib): replace Vec::set_len(0) with clear 2018-08-02 14:02:49 -07:00
Sean McArthur
069a32b1ac v0.12.7 2018-07-23 09:51:38 -07:00
Sean McArthur
6530a00a8e fix(http1): reduce closed connections when body is dropped
If a user makes use of `Body::is_end_stream` to optimize so as to not
need to do make a final poll just to receive `None`, previously the
connection would not have progressed its reading state to a finished
body, and so the connection would be closed.

Now, upon reading any chunk, the connection state will check if it
can know that the body would be finished, and progresses to a body
finished state sooner.

The integration tests were amplified by adding a naive hyper proxy
as a secondary test, which happens to make use of that optimization,
and thus caught the issue.
2018-07-23 09:39:19 -07:00
Sonny Scroggin
05c1179e82 docs(upgrade): fix link to upgrade example
Closes #1608
2018-07-20 22:25:07 -07:00
Sean McArthur
8a04a97464 v0.12.6 2018-07-11 17:20:20 -07:00
Eli Snow
13862d11ad feat(client): add ability to include SO_REUSEADDR option on sockets
Closes #1599
2018-07-11 12:13:59 -07:00
Hrvoje Ban
02a9c29e2e feat(client): implement rfc 6555 (happy eyeballs)
Update client connector to attempt a parallel connection using
alternative address family, if connection using preferred address family
takes too long.

Closes: #1316
2018-07-10 13:43:03 -07:00
Sean McArthur
5b5e309095 feat(server): add Builder::http1_pipeline_flush configuration
However, you probably shouldn't use it! It's `doc(hidden)`, since it
isn't the truest pipeline support. Instead, it just prevents flushing
until read buffer has been consumed.

It's only real use is for silly pipeline benchmarks.
2018-07-09 12:56:54 -07:00
Jonas Platte
51223efb8a docs(lib): Fix some typos 2018-07-08 10:10:12 -07:00
Sean McArthur
8991707a6a perf(http1): propagate service user error generic further into dispatcher
In the case of `Never`, this allows the optimizer to eliminate more code
inside the dispatcher, winning some more performance in benchmarks.
2018-07-06 15:01:53 -07:00
Özgür Akkurt
396e6022e0 docs(server): mention http2 support
mention http2 support in server module documentation.

Closes #1578
2018-07-05 10:38:13 -07:00
Sean McArthur
d42c983e3b test(http1): fix unused import warnings of Bytes when debug_assertions are off 2018-06-29 14:14:29 -07:00
Sean McArthur
b9ab8be986 refactor(common): ensure empty StaticBufs don't make IoVecs 2018-06-29 14:13:41 -07:00
Sean McArthur
5a3efda0e7 v0.12.5 2018-06-28 20:53:50 -07:00
Sean McArthur
8cf6f145ac v0.12.4 2018-06-28 16:21:27 -07:00
Sean McArthur
c03c39e0ff fix(client): fix keep-alive header detection when parsing responses 2018-06-28 15:15:50 -07:00
Sean McArthur
e7c7f2db05 refactor(h1): give better panics in debug mode when headers successfully parse illegal values 2018-06-28 12:53:54 -07:00
Sean McArthur
f2d464ac79 fix(client): try to reuse connections when pool checkout wins
If a checkout wins, meaning an idle connection became available before
a connect future completed, instead of just dropping the connect future,
it spawns it into the background executor to allow being placed into
the pool on completion.
2018-06-28 12:43:56 -07:00