Commit Graph

863 Commits

Author SHA1 Message Date
Nathan Fuchs
99baaa1015 fix(headers): Fix overflow with empty cookies 2015-03-15 23:51:08 -04:00
Jonathan Reem
932baac171 Merge pull request #371 from hyperium/cleanup
refactor(client): remove explicit Send implementations from Request/Resp...
2015-03-13 22:47:46 -07:00
Sean McArthur
d28bae3c91 refactor(client): remove explicit Send implementations from Request/Response 2015-03-13 19:54:34 -07:00
Sean McArthur
a2c6c4a25e Merge pull request #370 from hyperium/httparse
perf(http): changes http parsing to use httparse crate
2015-03-13 17:58:41 -07:00
Sean McArthur
b87bb20f0c perf(http): changes http parsing to use httparse crate
httparse is a http1 stateless push parser. This not only speeds up
parsing right now with sync io, but will also be useful for when we get
async io, since it's push based instead of pull.

BREAKING CHANGE: Several public functions and types in the `http` module
  have been removed. They have been replaced with 2 methods that handle
  all of the http1 parsing.
2015-03-13 16:56:13 -07:00
Sean McArthur
79200ed496 Merge pull request #360 from ctjhoa/master
docs(client): fix #357
2015-03-04 10:50:24 -08:00
Camille TJHOA
602c1e27fd docs(client): fix #357 2015-03-04 13:48:09 +01:00
Sean McArthur
d99a2006bd Merge pull request #359 from SBSTP/fix-charset-bug
fix(header): Fix charset parsing bug.
2015-03-03 23:38:34 -08:00
Simon Bernier St-Pierre
5a6e176f50 fix(header): Fix charset parsing bug. 2015-03-04 00:22:46 -05:00
Sean McArthur
003b6551cf v0.3.0 2015-03-03 21:09:45 -08:00
Sean McArthur
a9887c87f2 test(examples): fix warnings in examples 2015-03-03 21:05:52 -08:00
Sean McArthur
fdc78f8f89 Merge pull request #358 from hyperium/reparsing
feat(headers): adds re-parsing ability when getting typed headers
2015-03-03 20:47:47 -08:00
Hugo Duncan
180d9a92d9 feat(headers): add enum for Charset
Make Charset more strongly typed.
2015-03-03 20:46:41 -08:00
Hugo Duncan
235089a103 feat(headers): add AcceptCharset header
Adds support for the Accept-Charset header.  Encodes the charset as a
string.
2015-03-03 20:38:02 -08:00
Sean McArthur
2d83a79742 Merge pull request #356 from hyperium/q
feat(headers): add `q` function to ease creating Quality values
2015-03-03 19:52:11 -08:00
Sean McArthur
d68773c79f feat(headers): add q function to ease creating Quality values 2015-03-03 19:32:37 -08:00
Sean McArthur
df756871ed feat(headers): adds re-parsing ability when getting typed headers
BREAKING CHANGE: added requirement that all HeaderFormat implementations
  must also be fmt::Debug. This likely as easy as slapping
  #[derive(Debug)] on to any custom headers.
2015-03-03 18:51:29 -08:00
Sean McArthur
9e0770896b Merge pull request #354 from hyperium/new-io
feat(hyper): switch to std::io, std::net, and std::path.
2015-03-03 15:11:57 -08:00
Sean McArthur
0fd6fcd7c7 feat(hyper): switch to std::io, std::net, and std::path.
All instances of `old_io` and `old_path` were switched to use the new
shiny `std::io`, `std::net`, and `std::path` modules. This means that
`Request` and `Response` implement `Read` and `Write` now.

Because of the changes to `TcpListener`, this also takes the opportunity
to correct the method usage of `Server`. As with other
languages/frameworks, the server is first created with a handler, and
then a host/port is passed to a `listen` method. This reverses what
`Server` used to do.

Closes #347

BREAKING CHANGE: Check the docs. Everything was touched.
2015-03-03 14:32:03 -08:00
Sean McArthur
7235d3f74a Merge pull request #332 from pyfisch/improvquality
refactor(headers): Use u16 based newtype for quality value
2015-02-28 23:12:58 -05:00
Pyfisch
8f6ce453de refactor(headers): Use u16 based newtype for quality value
Using floating point numbers is problematic because comparison is inexact.
They also take more space than integral numbers in this case.

Add `FromPrimitve`, `ToPrimitive` and `Default` traits to quality newtype.

Closes: #330

BREAKING_CHANGE: Replace f32 quality values in quality items with a
Quality(u16) newtype. Valid values are from 0 to 1000.
2015-02-28 19:44:34 +01:00
Sean McArthur
b1b8bf1db7 v0.2.1 2015-02-27 06:01:44 -08:00
Sean McArthur
656552bf51 Merge pull request #340 from globin/rustup-4db0b3246-2015-02-25
Update to 4db0b3246 2015-02-25
2015-02-27 08:46:53 -05:00
Robin Gloster
1b6e6a040f fix(rustup): str.split and associated type changes 2015-02-27 13:33:21 +01:00
Jonathan Reem
9998417fe8 docs(README): Fix the example in the README. 2015-02-25 19:57:15 -08:00
Sean McArthur
3606f4aed8 Merge pull request #337 from AaronM04/master
Fixes compilation errors with latest rust
2015-02-25 22:06:17 -05:00
Aaron Miller
63910438c6 docs(client,server): fix compilation errors with latest Rust
Fix compilation errors relating to mutable borrowing the status
code from an immutably borrowed response. Also add the `extern crate
hyper` and appropriate `use` lines.
2015-02-25 13:29:18 -08:00
Jonathan Reem
0185afea91 Merge pull request #331 from filsmick/master
Add remove_raw method and corresponding test
2015-02-22 15:53:25 -08:00
filsmick (Yohaï Berreby)
4f576780c2 feat(headers): add remove_raw method and corresponding test
It was previously impossible to remove a header set by set_raw()

Closes #326
2015-02-22 16:16:39 +01:00
Sean McArthur
41fd8de243 v0.2.0 2015-02-21 15:15:09 -08:00
Sean McArthur
b985d85a5d Merge pull request #329 from hyperium/324
Rustup
2015-02-21 18:12:49 -05:00
Sean McArthur
4f5b97fefc fix(rustup): Send changes 2015-02-21 15:05:51 -08:00
Renato Zannon
98b8c4b137 fix(rustup): CowString is gone 2015-02-21 15:05:51 -08:00
Renato Zannon
598d8f93e4 fix(rustup): Extend now takes an IntoIterator 2015-02-21 15:05:51 -08:00
Renato Zannon
1904c4561f fix(rustup): Add PhantomData markers to phantom type users
Necessary since [RFC 738](https://github.com/rust-lang/rfcs/blob/master/text/0738-variance.md).
2015-02-21 15:05:50 -08:00
Renato Zannon
039e984f68 fix(rustup): Remove uses of the obsolete &a[] syntax 2015-02-21 15:05:50 -08:00
Renato Zannon
234fcdc3a2 fix(rustup): Fix signature of IntoCow 2015-02-21 15:05:50 -08:00
Renato Zannon
b0a72d80d0 feat(server): make AcceptorPool::accept() block and allow non'-static data
Change AcceptorPool to not spawn detached threads anymore. This,
together with the recent `Send` changes, allows the `work` closure to
close over non-`'static` data.

This doesn't change the high-level `Server` interface, because that
would make it's `listen` a blocking call (it's currently non-blocking)
- which would be a breaking change.
2015-02-21 15:05:50 -08:00
Renato Zannon
b47f936525 fix(rustup): update feature flags 2015-02-21 15:05:50 -08:00
Renato Zannon
fc2076cd53 fix(rustup): use module-level thread functions 2015-02-21 15:05:50 -08:00
Renato Zannon
f4a66b38cb fix(rustup): update lifetime bounds
Send no longer implies 'static; update needed lifetime bounds.
2015-02-21 15:05:50 -08:00
Sean McArthur
e8833c0c89 Merge pull request #325 from renato-zannon/macro-fix
fix(headers): use $crate when referring to hyper modules on macros
2015-02-19 13:35:02 -08:00
Renato Zannon
e246c3ace8 fix(headers): use $crate when referring to hyper modules on macros
This adds a $crate variable missed by de1be6726

Closes #323
2015-02-19 19:23:11 -02:00
Sean McArthur
bdb4d0e56e v0.1.13 2015-02-17 15:31:11 -08:00
Sean McArthur
e8529b3b98 Merge pull request #321 from pyfisch/refactorheaders
refactor(headers): Use macros for headers where possible
2015-02-17 08:46:03 -08:00
Pyfisch
de1be67262 refactor(headers): Use macros for headers where possible 2015-02-17 12:14:04 +01:00
Jonathan Reem
51bf1122dd Merge pull request #319 from pyfisch/partialordqualityitem
feat(headers): Implement PartialOrd for QualityItem
2015-02-15 14:30:43 -08:00
Pyfisch
2859d7ef4e feat(headers): Implement PartialOrd for QualityItem
PartialOrd is useful to sort Collections of QualityItems by quality.
So you can find the preferred match easier.

Closes #314
2015-02-15 18:01:03 +01:00
Sean McArthur
f8776f4c24 Merge pull request #312 from reem/acceptor-pool
feat(server): Rewrite the accept loop into a custom thread pool.
2015-02-14 17:49:25 -08:00
Sean McArthur
27b4573db1 Merge pull request #299 from hugoduncan/feature/add-accept-language
feat(headers): add AcceptLanguage header
2015-02-14 16:09:36 -08:00