Commit Graph

1707 Commits

Author SHA1 Message Date
Sean McArthur
c166268c07 fix(client): prevent panicking when determine Expiration in pool
On some OSes, `Instant` would start counting 0 from the boot time. That
would mean that any `Instant::now() - dur` soon after boot had a higher
risk of overflowing. Now, the expiration is determined by calling
`idle.elapsed()`, and comparing durations.

Closes #1215
2017-06-13 09:21:56 -07:00
Sean McArthur
620e00c6da docs(guides): add a link to guides in doc homepage 2017-06-12 20:27:18 -07:00
Corey Farwell
1059eb349a style(lib): address clippy code style warnings
* Remove unnecessary return statements.

* Combine identical `match` arms.

* Collapse nested conditional.

* Use `assert_ne` where applicable.

* Lifetime elision.
2017-06-12 20:16:20 -07:00
Sean McArthur
5d19ef88b4 test(status): fixes tests from removing 2017-06-12 17:04:55 -07:00
Sean McArthur
94ee6204ae feat(status): remove deprecated StatusClass
BREAKING CHANGE: All usage of `status.class()` should change to
  equivalent `status.is_*()` methods.
2017-06-12 16:27:25 -07:00
Sean McArthur
1ec9b5a327 docs(examples): remove unnecessary Clone and Copy from Echo 2017-06-12 11:22:20 -07:00
Corey Farwell
356e309a76 chore(dependencies): upgrade base64 to 0.6 2017-06-11 21:39:30 -07:00
Sean McArthur
e3834457da chore(ci): update appveyor to use stable instead of nightly 2017-06-08 13:43:43 -07:00
Sean McArthur
efa5e7f341 chore(dependencies): update futures to 0.1.14, since we use new apis 2017-06-08 13:07:33 -07:00
Sean McArthur
f273224f21 feat(mime): upgrade to mime v0.3
The new mime crate has several benefits:

- Faster formatting
- Easier to use. Most common mime types are now just constants, like
  `mime::TEXT_PLAIN`.
- Proper suffix support.
- Extensible without breaking backwards compatiblity. This means we can
  always add new constants, but before we couldn't add new variants to the
  enums.
- It's now impossible for a `Mime` to contain invalid tokens. Before,
  with the `Ext(String)` variants, it was possible to create an illegal
  mime.

Closes #738

BREAKING CHANGE: Most uses of `mime` will likely break. There is no more
  `mime!` macro, nor a `Mime` constructor, nor `TopLevel` and `SubLevel`
  enums.

  Instead, in most cases, a constant exists that can now be used.

  For less common mime types, they can be created by parsing a string.
2017-06-08 13:00:12 -07:00
Sean McArthur
e2ed6f5868 refactor(chunk): make use of Bytes::extend instead of custom code 2017-06-07 17:48:26 -07:00
Corey Farwell
059f2b8725 chore(net): remove empty net file 2017-06-06 23:54:14 -07:00
Sean McArthur
acd62cda44 feat(lib): add raw_status feature in Cargo.toml
The `RawStatus` types on the `Response` are now gone by default. To make
use of them, the `raw_status` feature must be enabled in `Cargo.toml`.

BREAKING CHANGE: To use `RawStatus`, you must enable the `raw_status`
  crate feature.
2017-06-03 16:23:33 -07:00
Sean McArthur
76fc633613 Merge pull request #1199 from daboross/patch-1
fix(client): remove config requirement for Connect
2017-06-03 14:55:07 -07:00
Sean McArthur
9036df2f4c chore(ci): update minimum rust version to 1.15 2017-06-03 14:42:42 -07:00
Sean McArthur
144bbc3d01 Merge pull request #1203 from daboross/patch-2
fix(http,server): Update tests to use non-deprecated futures methods.
2017-06-03 14:28:35 -07:00
David Ross
70948a24b0 fix(http,server): Update tests to use non-deprecated futures methods.
These seem mostly to be renames, with the exception of Unpark -> Notify.
2017-06-02 23:33:19 -07:00
David Ross
5391d02c10 fix(client): remove config requirement for Connect
Remove requirement when calling client::Config::connector() that the connector implements Connect.

Removing this requirement allows users to set the connector back to UseDefaultConnector. Previously,
this was not possible.
2017-06-01 23:38:01 -07:00
mayah
edc1c0dd01 fix(header): add Cookie::iter() 2017-05-29 11:16:09 -07:00
Sean McArthur
bdd2e1a3ad perf(server): cache renderings of the Date header
This is actually one of the biggest impacts to benchmark performances at
this point. Caching the rendering of the Date header improves "hello
world" benchmarks by around 10%.
2017-05-26 12:29:26 -07:00
Sean McArthur
78a8eed7f1 test(http): addn a benchmark for encoding a response head 2017-05-25 11:41:56 -07:00
Sean McArthur
2cbf4ef85f refactor(http): reduce complexity of determing an Encoder 2017-05-25 10:38:37 -07:00
Sean McArthur
e69cd1ab3a style(header): clean up extra whitespace in ContentLength file 2017-05-25 10:34:35 -07:00
Sean McArthur
9688c8b8ae perf(header): add #[inline] to header! macros 2017-05-25 10:32:25 -07:00
Sean McArthur
40c575cc59 perf(header): move a branch out of a loop in fmt_comma_delimited 2017-05-25 10:31:20 -07:00
Sean McArthur
6d8071b3ce Merge pull request #1177 from yazaddaruvala/master
Random Refactors
2017-05-22 23:40:02 -07:00
Yazad Daruvala
e134b890ef refactor(http): combine reserve_read_buf into read_from_io 2017-05-22 22:06:03 -07:00
Yazad Daruvala
6c8e6acaff refactor(http): remove the commented out code in http::h1 2017-05-22 22:06:03 -07:00
Yazad Daruvala
2f0470bcf3 refactor(http): delete some indirection around Http1Transaction::parse 2017-05-22 22:06:03 -07:00
Sean McArthur
09fe9e6a80 Merge pull request #1183 from MJDSys/nightly_unused_unimplemented
fix(lib): Remove unused unimplemented! macro.
2017-05-22 10:26:30 -07:00
Sean McArthur
f4179d0fab Merge pull request #1185 from sanmai-NL/rename_bind_docs
docs(server): refer to `bind` method, not `serve`
2017-05-20 10:35:50 -05:00
Sander Maijers
c07872951b docs(server): refer to bind method, not serve
Fixes #1180.
2017-05-20 15:08:41 +02:00
Matthew Dawson
ac40b453ec fix(lib): Remove unused unimplemented! macro.
This macro isn't used anywhere, std now has an unimplemented macro
if we want to use it, and the nightly compiler now warns that this
unused.  This warning is a failure when compiling tests.
2017-05-19 23:51:43 +00:00
Sean McArthur
12d01e4023 Merge pull request #1178 from utkarshkukreti/issue-1176
fix(uri): fix parse for empty path and '/' or '?' in fragment
2017-05-17 10:30:27 -05:00
Utkarsh Kukreti
559f21a664 fix(uri): fix parse for empty path and '/' or '?' in fragment
Fixes #1176.
2017-05-17 17:09:20 +05:30
Sean McArthur
33eb8f95a3 perf(http): use custom type for ParseEof error instead of string error 2017-05-12 16:54:24 -07:00
Sean McArthur
7f6673c4cd docs(examples): remove distracting derive(Clone, Copy) from Hello 2017-05-12 16:35:27 -07:00
Sean McArthur
c036fd6056 test(http): fix conn tests with higher init buffer size 2017-05-12 16:35:27 -07:00
Sean McArthur
917f482e70 Merge pull request #1167 from golem131/dependency_update
feat(headers): update to unicase 2.0 and base64 0.5
2017-05-12 16:10:53 -07:00
Sean McArthur
900ce1c36f test(server): add benchmark of hyper server vs raw tcp 2017-05-12 16:04:47 -07:00
Sean McArthur
5caf590c06 perf(http): increase size of initial buffer to 8kb 2017-05-12 15:39:34 -07:00
golem131
ca22eae5ac feat(headers): update to base64 0.5 2017-05-12 13:40:26 +03:00
Sean McArthur
c18d47db2f refactor(status): add allow(deprecated) to StatusClass enum for older rust versions 2017-05-11 14:25:35 -07:00
Sean McArthur
638582fae2 refactor(status): deprecate StatusClass 2017-05-11 12:46:46 -07:00
Sean McArthur
ae09d99375 Merge pull request #1168 from hyperium/unicase
refactor(lib): update unicase to 2.0
2017-05-11 12:12:40 -07:00
Sean McArthur
c81edd41d7 refactor(lib): update unicase to 2.0
BREAKING CHANGE: Some headers used `UniCase`, but now use
  `unicase::Ascii`. Upgrade code to `Ascii::new(s)`.
2017-05-10 16:14:59 -07:00
Sean McArthur
fed04dfb58 Merge pull request #1159 from dorfsmay/ignore_invalid_cookies
Ignore invalid cookies
2017-05-08 22:46:51 -07:00
Sean McArthur
6655134583 refactor(client): make HttpConnector lazy 2017-05-08 11:51:20 -07:00
Sean McArthur
e6b588b81d docs(client): remove outdated reference to Handler trait 2017-05-08 11:50:54 -07:00
Sean McArthur
696dbe5bf4 Merge pull request #1163 from taku0/content-type_octet-stream
feat(headers): add ContentType::octet_stream() constructor
2017-05-03 09:28:31 -07:00