2522 Commits

Author SHA1 Message Date
Sean McArthur
06f8375491 update travis links 2014-09-18 16:48:07 -07:00
Sean McArthur
4428ec09da update docs link 2014-09-18 16:46:58 -07:00
Sean McArthur
f8ed48bbe3 Merge pull request #42 from seanmonstar/http-writer
adds HttpWriters
2014-09-18 14:10:01 -07:00
Sean McArthur
1c472a220a adds HttpWriters 2014-09-18 12:17:53 -07:00
Sean McArthur
b9ea1fd9b8 Merge pull request #45 from seanmonstar/rustup
update deprecated syntax
2014-09-17 19:24:55 -07:00
Sean McArthur
da9de1659e update deprecated syntax 2014-09-17 19:20:34 -07:00
Sean McArthur
d603895d7b Merge pull request #38 from reem/persistent-headers
Refactor Header representation to not store the raw representation
2014-09-16 19:05:54 -07:00
Sean McArthur
e6040523c9 Merge pull request #37 from seanmonstar/ssl
ssl for the client
2014-09-16 18:55:38 -07:00
Jonathan Reem
7065a3f946 Disallow parsing as multiple types to prevent transient errors. 2014-09-16 16:31:05 -07:00
Sean McArthur
42e69e1f2e ssl for the client 2014-09-15 21:12:19 -07:00
Jonathan Reem
fdcd25356d Refactor Header representation to not store the raw representation
This disallows reparsing, but since that can be a significant source
of errors I think this is actually beneficial.

This also refactors to avoid storing the TypeId, though that is less
of a gain.
2014-09-15 19:21:21 -07:00
Jonathan Reem
2ca119fd80 Added Typeable dependency. 2014-09-15 19:21:17 -07:00
Sean McArthur
b8e3178d05 Merge pull request #36 from seanmonstar/issue-35
adjust representation of internal Items
2014-09-15 18:14:26 -07:00
Sean McArthur
a0c4edb6e5 adjust representation of internal Items 2014-09-14 10:26:47 -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
4115c0e219 Moved WriteStatus, Fresh, and Streaming in to the net module. 2014-09-10 17:16:13 -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
Sean McArthur
38a47889d9 Merge pull request #25 from reem/server-bind-multiple-addresses
Change Server to contain a Vec of (ip, port) pairs to allow repeat
2014-09-10 16:20:53 -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
c2d9e34376 Change Server to contain a Vec of (ip, port) pairs to allow repeat listening
Expose Server::many for creating a Server that will listen on many (ip, port)
pairs.

Handler still receives a simple Iterator of (Request, Response) pairs.

This is a breaking change since it changes the representation of Listener,
but Handler and Server::http are unchanged in their API.

Fixes #7
2014-09-10 11:55:46 -07:00
Sean McArthur
8e95d4bc42 Merge pull request #31 from reem/rename-rfc7230
Rename rfc7230 to http to more clearly indicate its purpose.
2014-09-09 19:31:21 -07:00
Jonathan Reem
2aabf1b8e6 Rename rfc7230 to http to more clearly indicate its purpose. 2014-09-09 17:37:01 -07:00
Sean McArthur
b90341309f Merge pull request #29 from reem/network-stream
Abstract over NetworkStream using dynamic dispatch
2014-09-09 17:24:57 -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
ed491655dd Use dynamic dispatch for client Request and Response through Box<NetworkStream>
Also adds a convenience `abstract` method to NetworkStream for creating
Box<NetworkStream + Send> from a NetworkStream.
2014-09-09 17:06:27 -07:00
Jonathan Reem
8026867334 Deny missing documentation and all warnings for cleaner builds. 2014-09-09 17:06:23 -07:00
Jonathan Reem
76a58940d8 Use trait objects and dynamic dispatch to abstract over NetworkStream
Server and client benchmarks show that this makes very little difference
in performance and using dynamic dispatch here is significantly more ergonomic.

This also bounds NetworkStream with Send to prevent incorrect implementations.

Allows the implementation of mock streams for testing and flexibility.

Fixes #5
2014-09-09 17:05:59 -07:00
Sean McArthur
4eb48ab799 Merge pull request #30 from reem/dont-lose-transfer-encoding
Parse Transfer Encodings that we don't handle
2014-09-09 16:05:26 -07:00
Sean McArthur
0285fc2acc Abstract out NetworkStream
This introduces a new Trait, NetworkStream, which abstracts over
the functionality provided by TcpStream so that it can be easily
mocked and extended in testing and hyper can be used for
other connection sources.
2014-09-09 14:55:14 -07:00
Jonathan Reem
d11f1d5a4d Parse Transfer Encodings that we don't handle
We should not throw away information here, as downstream users
may want to handle alternative encodings.
2014-09-09 14:38:38 -07:00
Sean McArthur
a8d7b681da Merge pull request #28 from reem/fix-server-bench
Fix server benchmark for Response representation changes.
2014-09-09 13:52:28 -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
Sean McArthur
2ae521de0b Merge pull request #26 from reem/expand-travis
Expand travis to build docs and run benchmarks
2014-09-08 22:42:51 -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
7c74a29cd0 Expand travis to compile benchmarks 2014-09-08 21:55:19 -07:00
Sean McArthur
d171d1c04c Merge pull request #21 from reem/response-parts
Provide Response::<Fresh>::deconstruct to deconstruct a Response.
2014-09-08 19:34:32 -07:00
Sean McArthur
7c7a26803f Merge pull request #24 from reem/fix-concurrent-server
Fix concurrent server example for new Response representation.
2014-09-08 18:39:43 -07:00
Jonathan Reem
d02c24e1ee Provide Response::<Fresh>::deconstruct to deconstruct a Response.
This allows downstream frameworks by-value access to these fields,
letting them create their own Response abstractions out of hyper's
Response.
2014-09-08 18:37:38 -07:00
Jonathan Reem
622a18cd37 Fix concurrent server example for new Response representation. 2014-09-08 18:34:29 -07:00
Sean McArthur
e32845cefb Merge pull request #19 from reem/static-response-states
Statically track the status of a Response by using a Phantom Type
2014-09-08 18:27:13 -07:00
Sean McArthur
5a98d16b8e Merge pull request #23 from reem/concurrent-example
Added example of a concurrent server
2014-09-08 18:26:51 -07:00
Jonathan Reem
ce61781cbd Added example of a concurrent server
Simple example that demonstrates how to create a concurrent
server on top of the primitives exposed by hyper.
2014-09-08 18:24:55 -07:00
Jonathan Reem
13bb07e02d Updated examples and benchmarks for new Response representation. 2014-09-08 16:52:27 -07:00
Jonathan Reem
872dcf758c Statically track the status of a Response by using a Phantom Type
Introduces two Phantom Types, Fresh and Streaming, which indicate the status
of a Response.

Response::start translates an Response<Fresh> into a
Response<Streaming> by writing the StatusCode and Headers.

Response<Fresh> allows modification of Headers and StatusCode, but does
not allow writing to the body. Response<Streaming> has the opposite privileges.
2014-09-08 16:52:24 -07:00
Sean McArthur
77be77a6c1 Merge pull request #20 from reem/header-submodules
Split common headers into a submodule and into their own files
2014-09-08 16:45:16 -07:00
Jonathan Reem
f2c09c5743 Split common headers into a submodule and into their own files
This is a more extensible place to put them and doesn't clutter up
header/mod.rs as much as the old scheme did.

Fixes #8
2014-09-08 16:20:50 -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