Commit Graph

861 Commits

Author SHA1 Message Date
Sean McArthur
38f40c7f6a v0.4.0 2015-05-07 13:47:57 -07:00
Sean McArthur
59f1b71fb3 Merge pull request #512 from hyperium/osx-shutdown
fix(net): ignore NotConnected error in NetworkStream.close
2015-05-07 13:13:41 -07:00
Sean McArthur
6fd1e88b0f Merge pull request #514 from hyperium/res-send
feat(server): add Response.send to write a sized body
2015-05-07 13:08:50 -07:00
Sean McArthur
6be60052c6 fix(net): ignore NotConnected error in NetworkStream.close
On OSX, calling shutdown a second time will return a NotConnected error.
This commit will just ignore it, since we can agree that if a stream is
"not connected", it is in fact "closed".

Closes #508
2015-05-07 13:06:35 -07:00
Sean McArthur
d5558b687d feat(server): add Response.send to write a sized body
Closes #446
2015-05-07 11:03:45 -07:00
Sean McArthur
d294ea501d Merge pull request #511 from hyperium/drop-res
feat(server): dropping a Response will write out to the underlying stream
2015-05-06 15:16:46 -07:00
Sean McArthur
a9dcc59cd9 feat(server): dropping a Response will write out to the underlying stream 2015-05-06 15:12:38 -07:00
Sean McArthur
71b26dfcfa Merge pull request #510 from pyfisch/increasecov
tests(hyper): Add tests to increase coverage
2015-05-06 11:19:56 -07:00
Pyfisch
ff346f147f refactor(hyper): add tests and refactor to increase coverage 2015-05-06 19:39:54 +02:00
Jonathan Reem
7f5e0382d9 Merge pull request #509 from pyfisch/patch-1
docs(readme): Add coverage status badge to README.md
2015-05-06 00:06:49 -07:00
Pyfisch
76ee86a441 docs(readme): Add coverage status badge to README.md 2015-05-06 07:44:50 +02:00
Sean McArthur
37dbf5ab44 Merge pull request #494 from pyfisch/traviskcov
chore(travis): Enable test coverage generation
2015-05-05 19:16:42 -07:00
Sean McArthur
0b6db397a5 Merge pull request #506 from hyperium/error-ssl
feat(error): add Ssl variant to hyper::Error
2015-05-05 18:49:09 -07:00
Sean McArthur
972b3a388a feat(error): add Ssl variant to hyper::Error
The errors from openssl were previously boxed into a
Box<std::error::Error>, which lost some specifics and made it difficult
to match against. To solve this, an `Ssl` variant is added to the
`Error` enum of hyper, and is returned when openssl returns specific
errors.

Closes #483

BREAKING CHANGE: Adds a variant to `hyper::Error`, which may break any
exhaustive matches.
2015-05-05 18:25:19 -07:00
Sean McArthur
18f7dd7d5b Merge pull request #507 from tshepang/typos
fix typos caught by codespell
2015-05-05 17:54:04 -07:00
Tshepang Lekhonkhobe
7ddea2791c docs(misc): fix typos caught by codespell 2015-05-06 02:34:07 +02:00
Sean McArthur
67340a5d3e Merge pull request #463 from hyperium/error-rename
refactor(error): remove redundant parts of error names
2015-05-05 12:34:00 -07:00
Sean McArthur
9ba074d150 refactor(error): remove redundant parts of error names
The old names followed the old style of including the module name and
"Error" in each variant. The new style is to refer to an error from its
owning module, and variants are now scoped to their enum, so there's no
need to include the enum name in the variant name.

BREAKING CHANGE: The terms `Http` and `Error` have been removed from the Error
  type and its variants. `HttpError` should now be accessed as `hyper::Error`,
  and variants like `HttpIoError` should be accessed as `Error::Io`.
2015-05-05 11:53:09 -07:00
Marko Lalic
c29af72972 feat(method): implement AsRef<str> for Method
This lets us obtain the string representation of the method in a
convenient and efficient manner.
2015-05-04 18:13:31 -07:00
Sean McArthur
a1e59fc6f9 Merge pull request #502 from pyfisch/accesscontrolalloworigin
feat(headers): Allow `null` value in Access-Control-Allow-Origin
2015-05-04 11:13:43 -07:00
Sean McArthur
c238890fa6 Merge pull request #503 from pyfisch/nice2
refactor(headers): Improve docs, fix nits, make formatting faster
2015-05-04 11:11:08 -07:00
Sean McArthur
33146bdbc2 Merge pull request #499 from pyfisch/upgradeprotocol
feat(headers): Parse Upgrade header protocols further
2015-05-04 10:28:55 -07:00
Pyfisch
db4d89189a style(headers): Break lines with over 100 characters 2015-05-03 15:45:11 +02:00
Pyfisch
66d54d03e7 refactor(headers): Improve docs, fix nits, make formatting faster
src/header/parsing.rs now uses unsafe get_unchecked() again, I don't
know why it was removed.
2015-05-03 13:56:32 +02:00
Pyfisch
5e3417145c feat(headers): Allow null value in Access-Control-Allow-Origin
The spec says the header can be either a `*`, `null` or an URL.
Improve docs of header.

BREAKING CHANGE: Add variant to Access-Control-Allow-Origin enum
2015-05-03 11:24:23 +02:00
Pyfisch
f47d11b97b feat(headers): Parse Upgrade header protocols further
Parses protocols into a name and a value part matching the RFC.
An enum contains all registered or known protocols, but contains
an extension variant.

Closes #480

BREAKING CHANGE: Upgrade header Protocol changed.
2015-05-03 10:02:48 +02:00
Sean McArthur
b916a7b18c Merge pull request #501 from pyfisch/from
feat(headers): Add From header field
2015-05-02 13:47:35 -07:00
Sean McArthur
ec13f982fe Merge pull request #500 from pyfisch/acceptranges
feat(headers): Add Accept-Ranges header field
2015-05-02 13:45:56 -07:00
Pyfisch
ce9c4af1e0 feat(headers): Add From header field 2015-05-02 21:18:17 +02:00
Pyfisch
2dbe3f9b9a feat(headers): Add Accept-Ranges header field 2015-05-02 21:11:50 +02:00
Sean McArthur
117fe927ca Merge pull request #493 from pyfisch/nice
refactor(hyper): Fix a few nits
2015-05-02 09:47:07 -07:00
Pyfisch
a6974c99d3 refactor(headers): Fail to parse single value header values
A single value header value can't be "", so `from_one_raw_str()` now
returns `None` on empty values. This makes custom checks in headers
obsolete.

BREAKING CHANGE: `from_one_raw_str()` returns `None` on empty values.
2015-05-02 16:40:53 +02:00
Sean McArthur
da62ed4226 v0.3.16 2015-05-01 17:38:43 -07:00
Sean McArthur
d58eda4605 Merge pull request #498 from hyperium/raw-status
fix(http): keep raw reason phrase in RawStatus
2015-05-01 17:37:07 -07:00
Sean McArthur
8cdb9d5d3b fix(http): keep raw reason phrase in RawStatus
Closes #497
2015-05-01 15:08:48 -07:00
Sean McArthur
6d7ae81e36 Merge pull request #492 from hyperium/header-macro-example
fix(header): make test_module of header! optional
2015-05-01 14:27:55 -07:00
Sean McArthur
a5ce9c59fa fix(header): make test_module of header! optional
Closes #490
2015-05-01 14:27:17 -07:00
Pyfisch
f270b1d79a chore(travis): Enable test coverage generation
Generates a test coverage using kcov on travis. The coverage is only
generated for beta builds. kcov requires using sudo, so beta builds
can't run on container infrastructure anymore.

Closes #44
2015-05-01 12:01:22 +02:00
Pyfisch
6b59bd28b7 refactor(hyper): Fix a few nits 2015-05-01 11:58:15 +02:00
Sean McArthur
1426a4ce34 Merge pull request #491 from pyfisch/ifrangeheader
feat(headers): Add If-Range header
2015-04-30 15:05:52 -07:00
Pyfisch
a39735f1d3 feat(headers): Add If-Range header
Closes #388
2015-04-30 20:30:47 +02:00
Sean McArthur
92ee51acdb Merge pull request #489 from Byron/master
fix(header): exporting test_header! macro
2015-04-30 10:49:42 -07:00
Sebastian Thiel
2bc5a779bd fix(header): exporting test_header! macro
That way, third-parties can keep using the `header!` macro, which
now requires the `test_header!` macro as well.

Considering the `header!` macro is exported and part of the public
API, it was not desired to prevent it's usage in any way.
2015-04-30 11:05:21 +02:00
Sean McArthur
06d072bca1 Merge pull request #486 from hyperium/pool
feat(client): add a Connection Pool
2015-04-29 17:30:29 -07:00
Sean McArthur
06d0091b6d v0.3.15 2015-04-29 14:10:09 -07:00
Sean McArthur
1e72a8ab3a feat(client): add a Connection Pool
This adds a connection pool to the Client that is used by default. It
accepts any other NetworkConnector, and simply acts as a
NetworkConnector itself. Other Pools can exist by simply providing a
custom NetworkConnector. This Pool is only used by default if you also
use the default connector, which is `HttpConnector`. If you wish to use
the Pool with a custom connector, you'll need to create the Pool with
your custom connector, and then pass that pool to the
Client::with_connector.

This also adds a method to `NetworkStream`, `close`, which can be used
to know when the Stream should be put down, because a server requested
that the connection close instead of be kept alive.

Closes #363
Closes #41
2015-04-29 12:58:28 -07:00
Sean McArthur
362044c32c Merge branch 'beta-travis' 2015-04-28 12:43:50 -07:00
Sean McArthur
a84a270518 Merge pull request #487 from pyfisch/headertests2
Bugfixes, tests and documentation for headers
2015-04-28 12:38:07 -07:00
Pyfisch
14f46035b7 docs(headers): Update documentation of all remaining headers that use macros 2015-04-28 20:31:30 +02:00
Sean McArthur
f01cecbc06 chore(travis): add beta testing to travis-ci 2015-04-28 10:35:53 -07:00