Commit Graph

146 Commits

Author SHA1 Message Date
Jonathan Reem
93fcd05b9d Miscellaneous fixes and test updates for all the other changes
- http::LINE_ENDING is now an &'static str
2015-01-06 01:15:47 +01:00
Jonathan Reem
f0fe878ec8 More Rust updates:
- Some stray deriving -> derive changes
- use::{mod} -> use::{self}
- fmt.write -> fmt.write_str

This does not catch the last case of fmt.write_str in the
Show impl of a Header Item. This will need to be changed
separately.
2015-01-05 22:50:10 +01:00
Jonathan Reem
7f3a33f903 #[deriving] -> #[derive] 2015-01-03 20:31:48 +01:00
Sean McArthur
451074b0a6 rust upgrade 2014-12-29 17:42:48 -08:00
Lorenzo Villani
358b3c3a38 Typo: wrapped -> wrapper 2014-12-26 23:21:41 +01:00
Sean McArthur
691c70a380 update str::from_utf8 2014-12-23 12:55:53 -08:00
Jonathan Reem
90925f05ee (fix) Add semicolons at macro invocation sites. 2014-12-20 02:38:03 -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
0bba6e80ee rust upgrade 2014-12-12 12:24:54 -08:00
Sean McArthur
debebe8fbe rustup 2014-12-06 10:52:00 -08:00
Sean McArthur
e19330326d Merge pull request #161 from hyperium/mucell
refactor(headers): changed from rwlock to mucell underneath
2014-12-02 21:20:52 -08:00
Sean McArthur
d71d6549f7 refactor(headers): changed from rwlock to mucell underneath 2014-11-29 22:06:48 -08:00
Sean McArthur
8071cfa8bf feat(headers): header ergonomics
- Reexports all common::* as header::*
- Most headers implement Deref where it makes sense.

Closes #156
2014-11-29 13:55:50 -08:00
Chris Morgan
8e2255430c Drop the unnecessary dependency on typeable.
See also https://github.com/reem/rust-typeable/issues/3.
2014-11-22 17:20:44 +11: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
Jakob Gillich
35b7ec132e refactor(status): replace glob with namespaced variants 2014-11-19 22:07:04 +01:00
Kyle Dewey
d7e8b8b117 Now using use along with enums, as per https://github.com/rust-lang/rust/pull/18973. 2014-11-19 22:03:41 +01:00
Tim Kuehn
5605ade5dc impl Error and FromError for HttpError; replace instances of try_io! with try! 2014-11-10 22:59:18 -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
d51657a831 log fixes 2014-11-10 16:28:56 -08:00
Sean McArthur
bb45ac509d some more logging 2014-11-10 16:10:52 -08:00
Sean McArthur
5c224289ec adjustments to Cookie and SetCookie 2014-11-10 12:32:11 -08:00
Stanislav Panferov
a3fc51611f Add cookie_rs as default feature and implement conditional compilation. 2014-11-10 12:31:33 -08:00
Stanislav Panferov
0a624b10e0 Add cookie-rs and use cookie::Cookie in Cookie header. 2014-11-10 12:31:33 -08:00
Gilman Tolle
91a8e03e7a Implemented a typed Authorization header
An Authorization header contains a Scheme. If you have no real scheme,
you can use String as your scheme (Authorization<String>).

This includes the `Basic` scheme built-in.
2014-10-31 18:51:23 -07:00
Sean McArthur
f117ebe367 fix missing_docs lint name 2014-10-31 15:49:53 -07:00
Sean McArthur
0ab52c9009 add bits to deal with Upgrade requests 2014-10-27 20:36:57 -07:00
Sean McArthur
61e18141be fix client requests dropping the query string. fixes #75 2014-10-13 10:16:45 -07:00
bruse
3326e5f09c Fix typo in documentation 2014-09-28 03:23:05 +02:00
Sean McArthur
258a67fe76 enforce Request/Response to be Send 2014-09-25 09:52:24 -07:00
Jonathan Reem
80f275cbda Move internal design overview to documentation, add examples to README
While the README examples are not checked by rustdoc, they are important
to have as they show-off hyper to the world :)
2014-09-22 16:48:31 -07:00
Sean McArthur
1c472a220a adds HttpWriters 2014-09-18 12:17:53 -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
42e69e1f2e ssl for the client 2014-09-15 21:12:19 -07:00
Jonathan Reem
2ca119fd80 Added Typeable dependency. 2014-09-15 19:21:17 -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
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
Jonathan Reem
2aabf1b8e6 Rename rfc7230 to http to more clearly indicate its purpose. 2014-09-09 17:37:01 -07:00
Jonathan Reem
8026867334 Deny missing documentation and all warnings for cleaner builds. 2014-09-09 17:06:23 -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
Sean McArthur
eaa3cb46ee todos 2014-09-07 20:17:32 -07:00
Jonathan Reem
5f24bcecd4 Use an out-of-tree unsafe-any trait instead of a home-grown version.
This has the advantage of being separately checked, tested
and documented.
2014-09-07 09:49:10 +02: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
Sean McArthur
c905111f8c implementation 2014-09-01 18:39:24 -07:00