Commit Graph

146 Commits

Author SHA1 Message Date
Sean McArthur
a594341701 v0.11.8 2017-12-06 16:56:13 -08:00
Sean McArthur
3f62bde7b3 v0.11.7 2017-11-14 13:41:37 -08:00
Sean McArthur
b60d4cda3d chore(server): setup ServerProto pieces to be deprecated
- Adds a `server-proto` feature that is added to default features.
- If `server-proto` feature is not enabled, pieces that will eventually
  be deprecated and optional will be tagged deprecated, but with a note
  about the missing `server-proto` feature.
2017-11-09 15:45:13 -08:00
Sean McArthur
4b1e9d1bab v0.11.6 2017-10-02 18:21:41 -07:00
Sean McArthur
c2fd47f211 v0.11.5 2017-10-02 15:46:09 -07:00
Sean McArthur
9c80fdbb9e refactor(lib): rename http_types to http 2017-09-29 18:12:55 -07:00
Sean McArthur
d77fcff1c4 v0.11.4 2017-09-28 22:01:59 -07:00
Sean McArthur
5027435791 refactor(lib): rename internal http module to proto 2017-09-28 18:28:44 -07:00
Sean McArthur
217941cef2 v0.11.3 2017-09-28 16:43:50 -07:00
Sam Rijs
0c7d375ba3 feat(lib): implement compatibility with http crate 2017-09-22 12:07:57 -07:00
Sean McArthur
3b91fc65b2 fix(client): cleanup dropped pending Checkouts from Pool
Closes #1315
2017-09-18 13:29:31 -07:00
Bastien Orivel
627c4e3d0d fix(lib): Export hyper::RawStatus if the raw_status feature is enabled 2017-09-15 21:36:19 +02:00
Sean McArthur
4922bb9d18 v0.11.2 2017-07-27 14:21:24 -07:00
Sean McArthur
aa8a587528 chore(lib): add deny(warnings) back that was mistakenly removed 2017-07-27 14:17:27 -07:00
Sean McArthur
673e5cb1a3 fix(server): improve detection of when a Response can have a body
By knowing if the incoming Request was a HEAD, or checking for 204 or
304 status codes, the server will do a better job of either adding
or removing `Content-Length` and `Transfer-Encoding` headers.

Closes #1257
2017-07-13 12:19:53 -07:00
Sean McArthur
7ce3121132 v0.11.1 2017-07-03 15:08:38 -07:00
Yazad Daruvala
3021cd9dd8 refactor(uri): make ByteStr an implementation detail of uri 2017-06-23 21:58:15 -07:00
Sean McArthur
e92b57c4f5 v0.11.0 2017-06-13 12:54:29 -07:00
Sean McArthur
cee8692d81 refactor(header): replace url crate with percent-encoding 2017-06-13 10:55:12 -07:00
Sean McArthur
f953cafe27 feat(status): add StatusCode::try_from(u16).
This is a temporary function until the `TryFrom` trait stabilizes.

BREAKING CHANGE: Removes the undocumented `from_u16` function. Use
  `StatusCode::try_from` instead.

  Also makes the `status` module private. All imports of
  `hyper::status::StatusCode` should be `hyper::StatusCode`.
2017-06-13 09:50:46 -07:00
Sean McArthur
620e00c6da docs(guides): add a link to guides in doc homepage 2017-06-12 20:27:18 -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
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
Nick Gonzales
864d3e27a4 refactor(http): merge Request and Response from server and client
Request and Response are now visible from:
- hyper::{Request, Response}
- hyper::server::{Request, Response}
- hyper::client::{Request, Response}
They truly exist in the http module, but are re-exported to reduce the number of breaking changes.

request::new and response::new were renamed to ::from_wire to reduce confusion with Request::new
and Response::new. See issue #1126

Request now has an optional Body, because not all requests have bodies.
Use body_ref() to determine if a body exists.
Use body() to take the body, or construct one if no body exists.

Closes #1155

BREAKING CHANGE: Response::body() now consumes the response
2017-05-01 14:22:07 -06:00
Ran Benita
f382f45e65 refactor(lib): use try_nb! from tokio_io, not tokio_core
tokio_core::io is deprecated, and the try_nb! conceptually belongs to
that module. It is also available in tokio_io, so use that instead.
2017-04-30 14:36:42 +03:00
Sean McArthur
f05a58a1b2 chore(travis): set minimum rust version 2017-04-10 15:09:54 -07:00
Sean McArthur
4fb7e6ebc6 feat(lib): remove extern Url type usage
BREAKING CHANGE: The `Url` type is no longer used. Any instance in the
  `Client` API has had it replaced with `hyper::Uri`.

  This also means `Error::Uri` has changed types to
  `hyper::error::UriError`.

  The type `hyper::header::parsing::HTTP_VALUE` has been made private,
  as an implementation detail. The function `http_percent_encoding`
  should be used instead.
2017-03-21 11:03:57 -07:00
Alex Crichton
8554904dc9 refactor(lib): convert usage of tokio_core::io to tokio_io
This commit updates to the most recent versions (released today) of the various
Tokio libraries in use. Namely the `tokio_core::io` module has now been
deprecated in favor of an external `tokio-io` crate. This commit pulls in that
crate and uses the `AsyncRead + AsyncWrite` abstraction instead of `Io` from
tokio-core.

BREAKING CHANGE: Any external types that were using that had implemented `Io` will need to 
  implement `AsyncRead + AsyncWrite` from tokio_io.
2017-03-17 17:31:44 -07:00
Sean McArthur
65b3e08f69 feat(http): use the bytes crate for Chunk and internally 2017-03-01 14:15:47 -08:00
Guillaume Gomez
5a4bd497c9 fix(Uri): Reexport Uri struct publicly 2017-02-09 15:25:55 +01:00
Sean McArthur
cca798a09e fix(header): deprecate HeaderFormatter 2017-01-30 12:20:30 -08:00
Josh
5c890321ee feat(lib): export Method::Put at top level 2017-01-25 11:43:56 -08:00
Andy Moran
529ad564c3 refactor(header): Change to base64 serialize
Replace rustc-serialize with base64 crate.

Closes #1028
2017-01-23 23:09:14 -08:00
Sean McArthur
7d400398ab refactor(header): only import langtag macro for tests 2017-01-23 11:18:48 -08:00
Alex Crichton
f45e9c8e4f refactor(server): expose Http that implements ServerProto
The main changes are:

* The entry point is how `Http`, the implementation of `ServerProto`.
  This type has a `new` constructor as well as builder methods to
  configure it.

* A high-level entry point of `Http::bind` was added which returns a
  `Server`. Binding a protocol to a port requires a socket address
  (where to bind) as well as the instance of `NewService`. Internally
  this creates a core and a TCP listener.

* The returned `Server` has a few methods to learn about itself, e.g.
  `local_addr` and `handle`, but mainly has two methods: `run` and
  `run_until`.

* The `Server::run` entry point will execute a server infinitely, never
  having it exit.

* The `Server::run_until` method is intended as a graceful shutdown
  mechanism. When the provided future resolves the server stops
  accepting connections immediately and then waits for a fixed period of
  time for all active connections to get torn down, after which the
  whole server is torn down anyway.

* Finally a `Http::bind_connection` method exists as a low-level entry
  point to spawning a server connection. This is used by `Server::run`
  as is intended for external use in other event loops if necessary or
  otherwise low-level needs.

BREAKING CHANGE: `Server` is no longer the pimary entry point. Instead,
  an `Http` type is created  and then either `bind` to receiver a `Server`,
  or it can be passed to other Tokio things.
2017-01-18 14:09:20 -08:00
Guillaume Gomez
9036443e6b feat(uri): redesign RequestUri type into Uri
Closes #1000

BREAKING CHANGE: The name of `RequestUri` has changed to `Uri`. It is no
  longer an `enum`, but an opaque struct with getter methods.
2017-01-17 16:46:24 -08:00
Sean McArthur
0167f57d65 docs(cookie): fix examples for Cookie and SetCookie 2017-01-16 10:50:36 -08:00
Sean McArthur
637b170f52 refactor(header): change Cookie and SetCookie to use String
This removes the cookie crate, since it has an optional dependency on
openssl, which can cause massive breakage if toggled on. Instead, the
`Cookie` and `SetCookie` headers now just use a `String`. Anyone can
create any typed header, so it is easy to plug in different
implementations.

BREAKING CHANGE: The `Cookie` and `SetCookie` headers no longer use the
  cookie crate. New headers can be written for any header, or the ones
  provided in hyper can be accessed as strings.
2017-01-16 10:50:35 -08:00
Sean McArthur
2d2d5574a6 feat(lib): redesign API to use Futures and Tokio
There are many changes involved with this, but let's just talk about
user-facing changes.

- Creating a `Client` and `Server` now needs a Tokio `Core` event loop
to attach to.
- `Request` and `Response` both no longer implement the
`std::io::{Read,Write}` traits, but instead represent their bodies as a
`futures::Stream` of items, where each item is a `Chunk`.
- The `Client.request` method now takes a `Request`, instead of being
used as a builder, and returns a `Future` that resolves to `Response`.
- The `Handler` trait for servers is no more, and instead the Tokio
`Service` trait is used. This allows interoperability with generic
middleware.

BREAKING CHANGE: A big sweeping set of breaking changes.
2017-01-16 10:44:27 -08:00
Sean McArthur
81e6e98d80 docs(guide): adjust styles of the guides 2016-07-26 08:55:08 -07:00
Sean McArthur
12c69b5dd0 docs(guide): add meat to the Server Guide
Closes #806
2016-07-25 20:23:44 -07:00
Sean McArthur
e2264530e7 Merge pull request #864 from hyperium/less-deps
refactor(header): internalize traitobject and typeable
2016-07-14 20:36:43 -07:00
Sean McArthur
3e66377979 refactor(header): internalize traitobject and typeable 2016-07-14 17:27:59 -07:00
Sean McArthur
40745c5671 refactor(lib): moved LanguageTag export to header
BREAKING CHANGE: LanguageTag used to be at the crate root, but it is now
  in the `hyper::header` module.
2016-07-14 09:59:47 -07:00
Sean McArthur
ad9c580e9a fix(lib): make ControlError public 2016-06-14 11:24:28 -07:00
Sean McArthur
d35992d019 feat(lib): switch to non-blocking (asynchronous) IO
BREAKING CHANGE: This breaks a lot of the Client and Server APIs.
  Check the documentation for how Handlers can be used for asynchronous
  events.
2016-05-16 09:51:18 -07:00
Sean McArthur
01160abd92 feat(ssl): enable hostname verification by default for OpenSSL
Additionally disables SSLv2 and SSLv3, as those are universally considered
unsafe.

Closes #472
2016-05-08 10:04:37 -07:00
Simon Sapin
8fa7a98968 refactor(hyper): Update to rust-url 1.0
BREAKING CHANGE: The re-exported Url type has breaking changes.
2016-04-21 16:14:08 -07:00
Steven Fackler
f37315b270 feat(net): Add Ssl impls for security-framework
Cloese #755
2016-04-16 16:20:52 -07:00
Sean McArthur
b872969880 fix(timeouts): remove rust #![feature] for socket timeouts 2015-09-16 14:30:12 -07:00