Commit Graph

80 Commits

Author SHA1 Message Date
Jonathan Reem
618f95e10a (fix) Update examples and benchmarks to remove rust-http. 2014-12-20 03:07:05 -08:00
Sean McArthur
8c83a3358e feat(client): add a new Client struct with super powers
- Includes ergonomic traits like IntoUrl and IntoBody, allowing easy
usage.
- Client can have a RedirectPolicy.
- Client can have a SslVerifier.

Updated benchmarks for client. (Disabled rust-http client bench since it
hangs.)
2014-12-14 11:56:39 -08:00
Sean McArthur
3ac277b1f0 fix(ssl): set_hostname on ssl connections 2014-12-11 20:27:37 -08:00
Sean McArthur
36429ab50c refactor(net): NetworkConnecter no longer is for static usage
Instead, you can use an instance of a NetworkConnector with
`Request::with_connector`. This allows overloading of the NetworkStream
constructors, so that it is easy to modify how an `HttpStream` is
created, while still relying on the rest of the stream implementation.

BREAKING CHANGE
2014-12-04 17:39:38 -08:00
Jonathan Reem
368e46d3d9 Merge pull request #118 from hyperium/headers-clone
make Headers implement Clone
2014-11-21 05:16:38 -08:00
Sean McArthur
3cd9b10bcb feat(server): keep-alive!
Internals have been shuffled around such that Request and Reponse are
now given only a mutable reference to the stream, instead of being
allowed to consume it. This allows the server to re-use the streams if
keep-alive is true.

A task pool is used, and the number of the threads can currently be
adjusted by using the `listen_threads()` method on Server.

[breaking-change]
2014-11-20 21:40:55 -08:00
Jonathan Reem
7f2a01fca3 (fix) Fix benchmarks for rust API changes. 2014-11-19 15:13:30 -08:00
Sean McArthur
14d3209a72 make Headers implement Clone 2014-11-17 11:19:07 -08:00
Jonathan Reem
928f63c368 Removes intertwining, since it is slow and showing up in profiles
Intertwining was a nice feature, but it slows down hyper significantly,
so it is being removed.

There is some fallout from this, mainly that Incoming has had its type
parameter changed to `<A = HttpAcceptor>` and Handler receiving one
bounded with `A: NetworkAcceptor`.

[breaking-change]

Fixes #112
2014-11-10 17:26:55 -08:00
Sean McArthur
3c10a8a191 feat(server): change Incoming to iterator over Connections
A connection is returned from Incoming.next(), and can be passed to a
separate thread before any parsing happens. Call conn.open() to get a
Result<(Request, Response)>.

BREAKING CHANGE
2014-11-10 13:55:11 -08:00
Sean McArthur
3d7820d17e update using ToSocketAddr 2014-11-06 17:55:32 -08:00
Sean McArthur
4dd1fc5642 update benches with trait splits 2014-10-31 16:00:34 -07:00
Jonathan Reem
60af7c4565 (fix) fail! to panic! 2014-10-30 01:08:46 -07:00
Michael Hart
1222948414 Uppercase phrase constant to remove warnings
Latest 0.13.0-nightly gives this:

warning: static constant `phrase` should have an uppercase name such as
`PHRASE`, #[warn(non_upper_case_globals)] on by default
2014-10-18 18:46:02 -04:00
Sean McArthur
145a97377b fix deprecated usage in bench 2014-09-27 14:10:35 -07:00
Sean McArthur
42e69e1f2e ssl for the client 2014-09-15 21:12:19 -07:00
Sean McArthur
c40b5b0c53 Request::with_stream to use a different NetWorkStream in Client
added benches for mocking out the tcp process
2014-09-11 08:26:03 -07:00
Jonathan Reem
d5c6f33c34 Update the client API to statically track headers and move constructors
The client Request now uses the same system as a server Response to track
the write status of headers, and the API has been updated accordingly.

Additionally, the Request constructors have been moved onto the Request object
instead of being top-level hyper functions, as this better namespaces the
client and Server.
2014-09-10 17:04:49 -07:00
Jonathan Reem
cfd5cf3c68 Split Server::listen into two methods to hack around ICE related to default type params
Trying to default the type parameters leads to an ICE and strange type errors.
I think this is just due to the experimental state of default type params and
this change can be rolled back when they are fixed.
2014-09-10 12:48:43 -07:00
Jonathan Reem
0c674a1376 Update client benchmarks for new Listening representation. 2014-09-10 11:55:46 -07:00
Jonathan Reem
632250b431 Update benchmarks and introduce more default type params for remaining generics
The client benchmarks did not have to be changed at all for this whole
refactor, and the server benchmark only had to specify a single type parameter,
and only because it writes out the type of Listener, which is not normal
usage.
2014-09-09 17:06:27 -07:00
Jonathan Reem
a6096e8499 Fix server benchmark for Response representation changes. 2014-09-09 12:00:37 -07:00
Sean McArthur
29cf174a06 Merge pull request #22 from reem/bench-server
Benchmark hyper server against rust-http server.
2014-09-09 10:04:56 -07:00
Jonathan Reem
349196e566 Benchmark hyper server against rust-http server.
Adds a benchmark for testing the speed of hyper's server.

Due to limitations of rust-http, `cargo bench` now needs to be
killed after running because there is no way to kill a rust-http
server after you start it.
2014-09-08 22:34:06 -07:00
Jonathan Reem
13bb07e02d Updated examples and benchmarks for new Response representation. 2014-09-08 16:52:27 -07:00
Sean McArthur
fd6b014e7e fix benches/client with new Handler 2014-09-08 09:12:49 -07:00
Sean McArthur
eaa3cb46ee todos 2014-09-07 20:17:32 -07:00
Sean McArthur
4d77477c83 add Date header 2014-09-03 14:14:44 -07:00
Sean McArthur
055a783ef0 adding a custom header to benches 2014-09-02 20:52:29 -07:00
Sean McArthur
818fac4128 add some benches with other http libs 2014-09-02 12:06:16 -07:00