Commit Graph

781 Commits

Author SHA1 Message Date
Sean McArthur
b7d5920eb4 Merge pull request #424 from reem/stable-downcasting
chore(all): Move downcasting to a stable implementation.
2015-04-02 13:45:21 -07:00
Jonathan Reem
320d10d50d chore(all): Move downcasting to a stable implementation. 2015-04-02 13:30:41 -07:00
Sean McArthur
3dc8e7d6ff Merge pull request #416 from hyperium/into-cow
chore(stability): remove into_cow feature gate
2015-04-02 13:20:56 -07:00
Sean McArthur
ccd4814e69 chore(stability): remove into_cow feature gate 2015-04-02 13:01:49 -07:00
Sean McArthur
1b28515b6e v0.3.8 2015-04-02 12:57:45 -07:00
Sean McArthur
d3f042bd53 Merge pull request #423 from hyperium/rustup
fix(rustup): update to rust beta
2015-04-02 12:57:07 -07:00
Sean McArthur
0f5858f379 fix(rustup): update to rust beta 2015-04-02 12:56:20 -07:00
Sean McArthur
b4aeeb347c Merge pull request #419 from pyfisch/refactorheaders1
refactor(headers): Introduce header!() macro, improve documentation
2015-04-02 10:34:34 -07:00
Sean McArthur
05e505e280 Merge pull request #422 from pyfisch/patch-1
docs(contributing): Remove underscore from `BREAKING_CHANGE`
2015-04-02 10:13:37 -07:00
Pyfisch
262c450f90 refactor(headers): Introduce header!() macro, improve documentation
The new macro handles single value headers, list headers, and list
headers with at least one item.
It creates the item for the header and contains its documentation. The
new macro allows handling
more header cases in the future, it will also be possible to include
tests inside the macro.

BREAKING CHANGE: Removed impl_header!() and impl_list_header!() macros,
use new header!() macro.
2015-04-02 19:07:53 +02:00
Pyfisch
34392d9c5b docs(contributing): Remove underscore from BREAKING_CHANGE
See https://github.com/hyperium/hyper/pull/419
2015-04-02 19:07:08 +02:00
Sean McArthur
34220211f6 Merge pull request #418 from afck/patch-1
fix: typo in documentation
2015-04-01 10:01:24 -07:00
Andreas
841ff483cd docs(mainpage): fix typo 2015-04-01 16:52:49 +03:00
Sean McArthur
eeba13b34d Merge pull request #415 from hyperium/feat-alloc
chore(features): remove feature gate 'alloc'
2015-03-31 18:55:07 -07:00
Sean McArthur
dd5ee43750 chore(features): remove feature gate 'alloc' 2015-03-31 18:46:02 -07:00
Sean McArthur
dc55ecf982 v0.3.7 2015-03-31 17:09:01 -07:00
Sean McArthur
3d47f6fce8 Merge pull request #414 from hyperium/buf-init
fix(buffer): zero out new capacity when buffer grows
2015-03-31 17:07:50 -07:00
Sean McArthur
cfdabd70ec fix(buffer): zero out new capacity when buffer grows 2015-03-31 16:53:24 -07:00
Sean McArthur
ffa1e6235a Merge pull request #413 from pyfisch/httpdate
refactor(header): Implement `HttpDate`, a wrapper for dates
2015-03-31 13:53:09 -07:00
Pyfisch
6cf052bf0f refactor(header): Implement HttpDate, a wrapper for dates
Using `time::Tm` directly in HTTP header fields requires special handling to parse and format
the header values., this stops us from using the header macros. By wrapping `time::Time` in a
`HttpDate`, we can use the `FromStr` and `Display` traits of `HttpDate` like for most other values.

BREAKING_CHANGE: All code using one of the `Date`, `Expires`, `If-Modified-Since`,
`If-Unmodified-Since`, `Last-Modified` header fields needs to wrap `time::Tm`
with `HttpDate`. Removed `FromStr` trait of `Date`, `If-Modified-Sice` and `If-Unmodified-Sice`,
implementing the trait here is inconsistent with other headers.
2015-03-31 17:29:31 +02:00
Sean McArthur
6b2e731123 Merge pull request #410 from hyperium/buf-speed
perf(buffer): pull in std::io::BufReader improvements
2015-03-30 18:07:27 -07:00
Sean McArthur
163ffd6f70 perf(buffer): pull in std::io::BufReader improvements
The results of benches/client.rs are below.

Before:

    running 1 test
    test bench_mock_hyper ... bench:    321609 ns/iter (+/- 18127)

After:

    running 1 test
    test bench_mock_hyper ... bench:    239319 ns/iter (+/- 29938)
2015-03-30 18:01:17 -07:00
Sean McArthur
6775e993a9 Merge pull request #409 from pyfisch/entitytag
feat(entitytag): Add EntityTag comparison, make EntityTag safe to use
2015-03-30 12:51:32 -07:00
Pyfisch
9c21f7f953 feat(entitytag): Add EntityTag comparison, make EntityTag safe to use
Adds strong and weak comparison to EntityTag as described in the RFC,
add tests for this. Make EntityTag safe to use by hiding the tag field,
this prevents users from inserting malicious values for the tag. Invalid
values can screw up header formatting and may allow to insert headers.
Introduce EntityTag::new(), .tag() and .set_tag() methods. Fix Display
trait for EntityTag. DQUOTES were missing. Remove custom formatting in ETag
header. Improve docs.

BREAKING_CHANGE: EntityTag.tag is private, use EntityTag.tag() and
EntityTag.set_tag("foobar") to access it.
2015-03-30 21:36:55 +02:00
Sean McArthur
5f67c2d79b v0.3.6 2015-03-30 10:01:54 -07:00
Sean McArthur
4c5a42bcda Merge pull request #407 from hyperium/buffer-consume
fix(buffer): get_buf to not return consumed part of buffer
2015-03-29 22:54:13 -07:00
Sean McArthur
04e3b56515 fix(buffer): get_buf to not return consumed part of buffer
Closes #406
2015-03-29 21:20:09 -07:00
Sean McArthur
ce5231508e Merge pull request #404 from fhartwig/rustup
fix: rustup
2015-03-29 20:25:13 -07:00
Florian Hartwig
c9f2c841ff fix(rustup): get rid of slice pattern, add Reflect bounds
* remove slice pattern
* add `Reflect` trait bounds where necessary
2015-03-29 19:28:32 +02:00
Sean McArthur
8e1cd5e6e2 v0.3.5 2015-03-28 11:38:38 -07:00
Sean McArthur
6c31ea84e1 Merge pull request #401 from hyperium/packets
fix(http): read more before triggering TooLargeError
2015-03-28 11:37:43 -07:00
Sean McArthur
48700aa705 Merge pull request #402 from pyfisch/chorecaching
chore(travis): Enable caching of ./target folder.
2015-03-27 14:12:01 -07:00
Sean McArthur
e158870e28 Merge pull request #403 from hyperium/stabilize
Remove box_syntax and collections feature gates
2015-03-27 14:11:38 -07:00
Jonathan Reem
dbee6af8df refactor(hyper): Remove the box_syntax feature gate. 2015-03-27 13:37:30 -07:00
Sean McArthur
a62323cafe refactor(hyper): remove need for collections feature 2015-03-27 11:50:14 -07:00
Pyfisch
9747d86324 chore(travis): Enable caching of ./target folder.
Travis supports the caching of folders between builds.
By storing the ./target folder we can cache hyper's dependencies.
2015-03-27 19:12:33 +01:00
Sean McArthur
cb59f609c6 fix(http): read more before triggering TooLargeError
This includes a custom BufReader, since the one in libstd doesn't allow
reading additional data into the buffer without consuming it. This is
required because some connections may send shorter packets, and so we
need to perform multiple reads. After each read, the contents of the
buffer are passed to httparse to see if have a valid message. If so, the
proper amount of bytes are consumed. The additional bytes are left in
the buffer since they are the beginning of the body.

The buffer in this BufReader also grows in size, compared to the libstd
which is sized once. This is because we start with a smaller buffer,
since the majority of messages will be able to include their head in a
packet or 2. Therefore, it's a wasteful performance hit to allocate the
maximum size for every message. However, some headers can be quite big,
and to allow for many of them to be set, we include a maximum size. Once
we've hit the maximum buffer size, and still haven't determined the end
of the headers, a HttpTooLargeError will be returned.

Closes #389
2015-03-27 10:52:07 -07:00
Sean McArthur
b04f6d8e7a v0.3.4 2015-03-26 14:04:25 -07:00
Sean McArthur
2a964a6a3d Merge pull request #400 from Ryman/master
fix(rustup): static bounds required on Type definition, trivial_casts
2015-03-26 10:45:03 -07:00
Kevin Butler
eee7a85d3c fix(rustup): static bounds required on Type definition, trivial_casts 2015-03-26 17:02:20 +00:00
Sean McArthur
a10e7ded93 v0.3.3 2015-03-25 13:03:49 -07:00
Sean McArthur
b5f3bd05e5 Merge pull request #399 from fhartwig/rustup
fix(rustup): rustc 1.0.0-nightly (123a754cb 2015-03-24)
2015-03-25 12:57:57 -07:00
Florian Hartwig
3e456f00f9 fix(rustup): rustc 1.0.0-nightly (123a754cb 2015-03-24)
* fix `extern crate` declaration for rustc-serialize
* enable `into_cow` feature
* replace as_slice() calls by as_ref and enable `convert` feature
* use `core` feature in doc tests
2015-03-25 20:55:42 +01:00
Sean McArthur
e63a2dfc61 Merge pull request #398 from mattnenterprise/content-encoding-header
Implement Content-Encoding Header
2015-03-24 20:18:38 -07:00
Matt McCoy
2983e8dea2 feat(headers): Implementing content-encoding header
Closes #391
2015-03-24 21:57:52 -04:00
Jonathan Reem
a7e21219b2 Merge pull request #394 from zzmp/patch-3
docs(hyper): Tag docs for reexports
2015-03-24 00:34:47 -07:00
Zach Pomerantz
376eaddb88 docs(hyper): Tag docs for reexports 2015-03-24 00:28:52 -07:00
Jonathan Reem
89191cc481 Merge pull request #390 from hyperium/strptime
Add tests for header::parsing::tm_from_str and run benchmarks on travis.
2015-03-23 12:50:31 -07:00
Sean McArthur
26478644b4 test(benches): remove unused server bench 2015-03-23 11:14:11 -07:00
Sean McArthur
8e71f10b54 chore(travis): run benchmarks on travis 2015-03-23 10:41:33 -07:00