Commit Graph

2501 Commits

Author SHA1 Message Date
Sean McArthur
28629281ae Merge pull request #66 from bruse/master
Fix typo in documentation
2014-09-27 19:08:23 -07:00
bruse
3326e5f09c Fix typo in documentation 2014-09-28 03:23:05 +02:00
Sean McArthur
fbd0a41fbd Merge pull request #65 from hyperium/debug
Debug
2014-09-27 14:16:29 -07:00
Sean McArthur
145a97377b fix deprecated usage in bench 2014-09-27 14:10:35 -07:00
Sean McArthur
834cb09733 additional debug lines 2014-09-27 14:10:17 -07:00
Sean McArthur
5391e7f61a fix recursive overflow of read() 2014-09-27 14:09:56 -07:00
Sean McArthur
30dd736067 Merge pull request #48 from reem/immutable-header-getters
Store Header Items behind an RWLock
2014-09-27 11:23:19 -07:00
Jonathan Reem
d3a62fa0d5 Add get_mut for modifying the typed representation of Headers.
Also adds an associated test and updates code to use it instead
of cloning and setting when possible.
2014-09-27 00:17:59 -04:00
Jonathan Reem
858a09304a Remove get and rename get_ref to get
Since `get_ref` (now `get`) takes `&self` there is no need
for a special cloning method.
2014-09-27 00:17:59 -04:00
Jonathan Reem
91cc29e0aa Fixed a race condition in get_ref
If two threads attempted to `get_ref` the same Header under two
representations, then it was possible that the second thread would
overwrite the work of the first thread, causing the first thread
to do an unchecked downcast to the wrong type.

In the case where they were the same Header representation, then the
only damage would be that it would be parsed twice and would possibly
return a false negative in one thread.

The new code checks that it was not a queued lock and will not override
the work of another thread, but will accept it if the other thread parsed
the header as the same type. This also prevents duplicate parsing.
2014-09-27 00:17:58 -04:00
Jonathan Reem
e85ae48e16 Update server and client for changes in Headers mutability. 2014-09-27 00:17:58 -04:00
Jonathan Reem
90dbef1d03 Add tests for double-reads for Header to ensure safety. 2014-09-27 00:17:58 -04:00
Jonathan Reem
d00fc14765 Store Header Items behind an RWLock
This removes the need to receive `&mut self` in `get_ref` and `get.`

Since the interior mutability of the RWLock is needed only once,
it is safe to change the lifetime of the pointer given by read locks
as by then all mutation has been done.

Since `set` still requires `&mut self` there is no way to use the interior
mutability of the RWLock to modify an existing `&`-reference. However,
the use of interior mutability in `get_ref` means that `get_raw` is now
actually an unsafe operation because the (now `*const`) pointer could be
invalidated by a subsequent call to `get_ref.`

Fixes #47
2014-09-27 00:17:58 -04:00
Jonathan Reem
1b65d5e2e6 Merge pull request #63 from reem/de-deprecate-parse-delete
Remove deprecated items and parse DELETE
2014-09-27 00:11:59 -04:00
Jonathan Reem
8f35a03f51 Use the entry API instead of find_or_insert. 2014-09-26 22:59:13 -04:00
Jonathan Reem
8d1c6a790e Parse the DELETE method and transition to push from push_char. 2014-09-26 22:57:31 -04:00
Jonathan Reem
48dca53e88 Merge pull request #61 from hyperium/assert-send
enforce Request/Response to be Send
2014-09-25 16:01:29 -04:00
Sean McArthur
258a67fe76 enforce Request/Response to be Send 2014-09-25 09:52:24 -07:00
Sean McArthur
b14a56fb80 Merge pull request #60 from hyperium/rustup
update to rust master
2014-09-25 09:46:09 -07:00
Sean McArthur
3259f7dce9 update to rust master
fixing usage of a Private trait as bounds for a public trait
2014-09-24 19:57:03 -07:00
Sean McArthur
67f2a87dc3 Merge pull request #58 from hyperium/rustup
update to rust master
2014-09-23 21:55:17 -07:00
Sean McArthur
26e2a0c8f4 update to rust master 2014-09-23 21:47:27 -07:00
Sean McArthur
042526c7ad Merge pull request #57 from hyperium/case-insensitive
property treat header names as case insensitive
2014-09-23 21:37:52 -07:00
Sean McArthur
0191bff43a property treat header names as case insensitive 2014-09-23 09:02:58 -07:00
Jonathan Reem
11d8b12fa3 Fixed bad reference to echo server example. 2014-09-22 17:16:30 -07:00
Jonathan Reem
eb28a757bf Merge pull request #46 from reem/enhance-README
(doc) Documented the internal design of Hyper.
2014-09-22 16:52:58 -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
Jonathan Reem
939de07ae6 (doc) Documented the internal design of Hyper.
This includes a rationale and description of the overall design of
Hyper as well as providing a guide to understanding and navigating the
source.
2014-09-18 20:17:27 -07:00
Jonathan Reem
2329623096 (doc) Updated benchmarks for newest results.
This also adds new benchmarks for the Server and mocking the Clients.
2014-09-18 20:16:33 -07:00
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