Daniel Abramov
147ca9e4d3
Bump version
7 years ago
Daniel Abramov
7019210010
Merge pull request #17 from alexcrichton/ctl-pong
...
Add `Ping` and `Pong` variants to `Message`
7 years ago
Alex Crichton
9f6f42766e
Add `Ping` and `Pong` variants to `Message`
...
This'll allow removal/deprecation of the `send_ping` custom method but also
allow applications to react to `Pong` messages as appropriate.
Closes #16
7 years ago
Daniel Abramov
9d6c3058d5
Add travis badge to README.md
7 years ago
Daniel Abramov
a644d0bfdf
Add .travis.yml
7 years ago
Daniel Abramov
e36093047e
Update README.md with doc and crates.io badges
8 years ago
Daniel Abramov
dca6959219
Merge pull request #13 from bbigras/patch-1
...
fix sample code in README.md
8 years ago
Bruno Bigras
ceb22faacf
fix sample code in README.md
8 years ago
Alexey Galakhov
50ff2aaf56
Merge branch 'devel'
8 years ago
Alexey Galakhov
6faf90cd7b
trivial: remove commented-out code
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
bd9ac9673e
chore: cleanup docs and warnings, strict docs
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
686bc51b84
stream: set TCP_NODELAY on connect
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
f696771069
Generalize connect() interface.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
89251566fb
Bump version
8 years ago
Alexey Galakhov
626333bc1d
Merge commit 'e3c0ec30c8ed427d65abc8a7d76d003887f97016' into devel
8 years ago
Alexey Galakhov
c896ef73cf
Version 0.2.3 released.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
e3c0ec30c8
Fix close handling while read.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
52e68c8ff7
Merge branch 'master' into devel
8 years ago
Alexey Galakhov
22f7df0b46
Fix possible deadlock in handshake.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
e9ad145db6
Merge pull request #12 from seeekr/patch-1
...
improve doc in protocol/mod.rs
8 years ago
Denis Andrejew
624f1dec1a
improve doc in protocol/mod.rs
8 years ago
Alexey Galakhov
da7c401e7f
trivial: fix license badges in README.md
8 years ago
Alexey Galakhov
2a0081ca67
Bump version
8 years ago
Alexey Galakhov
6e8dc3214e
Merge branch 'master' into devel
8 years ago
Alexey Galakhov
9aff611dcc
Version 0.2.2 released.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
c0519b8abe
Relicense under MIT + Apache-2.0.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
6d10b40215
Flush stream after sending message
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
2d94eae478
Bump version
8 years ago
Alexey Galakhov
67aba05aeb
Version 0.2.1 released.
...
Fix "assertion failed" in unmasking.
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
c458d61f7d
Merge branch 'devel'
8 years ago
Alexey Galakhov
3abe419e98
Fix fast masking of unaligned data
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
01a9211a84
Move mask functions into a separate file
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
065c9af877
Version 0.2.0 released.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
b9f71029a3
Bump version
8 years ago
Alexey Galakhov
4e10065975
Merge branch 'devel'
8 years ago
Alexey Galakhov
9a3b29b05e
Merge branch 'devel'
8 years ago
Alexey Galakhov
d29e3948d2
Add Debug, Display and Error to HandshakeError
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
24f3bb7807
Add the possibility to pass extra request headers.
...
Closes : #5
Suggestions for a more convenient API are welcome.
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
66e30b2767
Return close frame with ConnectionClosed
...
This is a breaking change, thus bump the API version.
Closes : #10
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
8df6bdbeb0
Add Display to CloseFrame and CloseCode
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
bd37c71609
Replace tuple with CloseFrame struct
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
0e8113e6e0
Merge branch 'devel'
8 years ago
Alexey Galakhov
65248f159f
Merge pull request #7 from bluetech/misc-improvements
...
Miscellaneous improvements
8 years ago
Ran Benita
8e49bea00f
Fix InputBuffer::reserve() to not be a no-op
...
The current implementation uses the `remaining_mut()` function from the
bytes::BufMut implementation for Vec<u8>.
In terms of the BufMut trait, a Vec buffer has infinite capacity - you
can always write more to the buffer, since the Vec grows as needed.
Hence, the `remaining_mut` here actually returns +∞ (actually,
`usize::MAX - len`).
So the first `if` is always true, and the calls to `reserve` never
actually allocate the appropriate space. What happens instead is that
the `bytes_mut()` call in `read_from` picks up the slack, but it merely
grows the buffer a 64 bytes at a time, which slows things down.
This changes the check to use the Vec capacity instead of
`remaining_mut`. In my profile (sending 100,000 10KiB messages back and
forth), this reduces `__memmove_avx_unaligned_erms`'s share of the
total runtime from ~77% to ~53%.
8 years ago
Ran Benita
be834ac261
Replace unsafe endianness code with byteorder functions
8 years ago
Ran Benita
b5b9e77b03
Make env_logger a dev dependency
...
It is only used by the examples; libraries should only depend on the
`log` crate.
8 years ago
Ran Benita
ae30b8cd76
Apply a couple trivial clippy suggestions
8 years ago
Ran Benita
8955b55e62
Simplify concatenation code using slice::concat
8 years ago
Ran Benita
76e80ca9a3
Only allocate error message if the error occurred
...
Suggested by clippy:
warning: use of `ok_or` followed by a function call
--> src/handshake/server.rs:20:19
|
20 | let key = self.headers.find_first("Sec-WebSocket-Key")
| ___________________^ starting here...
21 | | .ok_or(Error::Protocol("Missing Sec-WebSocket-Key".into()))?;
| |_______________________________________________________________________^ ...ending here
|
= note: #[warn(or_fun_call)] on by default
help: try this
| let key = self.headers.find_first("Sec-WebSocket-Key").ok_or_else(|| Error::Protocol("Missing Sec-WebSocket-Key".into()))?;
= help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#or_fun_call
8 years ago
Ran Benita
3c600aa138
Speed up apply_mask() - part 2
...
This is using some unsafe code and assumptions about alignment to speed
up apply_mask() more.
In profiles, this optimization reduces it from ~55% of the total runtime
to ~7%.
8 years ago