Ran Benita
bdc42480b2
protocol: remove redundant closure
...
warning: redundant closure found
--> src/protocol/mod.rs:114:43
|
114 | config: config.unwrap_or_else(|| WebSocketConfig::default()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `WebSocketConfig::default`
|
= note: #[warn(redundant_closure)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#redundant_closure
7 years ago
Ran Benita
c7a71106ac
handshake: switch unwrap_or to a lazy unwrap_or_else
...
warning: use of `unwrap_or` followed by a function call
--> src/handshake/client.rs:55:53
|
55 | let mut headers = self.extra_headers.take().unwrap_or(vec![]);
| ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))`
|
= note: #[warn(or_fun_call)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#or_fun_call
7 years ago
Ran Benita
556db990b5
mask: take [u8; 4] by value
...
warning: this argument is passed by reference, but would be more efficient if passed by value
--> src/protocol/frame/mask.rs:21:46
|
21 | fn apply_mask_fallback(buf: &mut [u8], mask: &[u8; 4]) {
| ^^^^^^^^ help: consider passing by value instead: `[u8; 4]`
|
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#trivially_copy_pass_by_ref
7 years ago
Ran Benita
c211d046cb
handshake: remove .clone() from Copy types
...
warning: using `clone` on a `Copy` type
--> src/handshake/server.rs:159:21
|
159 | self.config.clone(),
| ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.config`
|
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#clone_on_copy
7 years ago
Ran Benita
2585feba44
Use struct initialization shorthand when possible
...
Clippy suggests it by default.
7 years ago
Ran Benita
368504b6e7
handshake: remove implied 'static
...
warning: Constants have by default a `'static` lifetime
--> src/handshake/mod.rs:113:21
|
113 | const WS_GUID: &'static [u8] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
| -^^^^^^^----- help: consider removing `'static`: `&[u8]`
|
= note: #[warn(const_static_lifetime)] on by default
= help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#const_static_lifetime
7 years ago
Alexey Galakhov
3772aaf163
chore: introduce frame size limit
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
50d1371e52
frame: cleanup frame API
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
75aa0d54f3
refactor: parse header separately from payload
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
20242d19f7
config: protocol: add message size limiting
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
a4f885f69f
protocol: improve write responsibility
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
e4a52cde05
mask: update for actual Rust version
...
Closes #35
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
cb671e1abc
trivial: improve documentation
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
59d7012702
Merge pull request #37 from bluetech/ununsafe
...
frame: eliminate an unsafe when reading message data into the buffer
7 years ago
Ran Benita
4cfe9a2be1
frame: eliminate an unsafe when reading message data into the buffer
...
The reason for the unsafe was presumably to avoid copying or
zero-initializing. This achieves the same but using only safe functions.
Note: there is no zero-initializing here because Cursor is "trusted" to
not read from the buffer and so skips the initialization:
https://github.com/rust-lang/rust/blob/master/src/libstd/io/cursor.rs#L241
(the Take wrapper delegates to its inner).
7 years ago
Alexey Galakhov
3e02fe5351
trivial: use released input_buffer version
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
fdb1a0ed50
frame: reject bad opcodes early
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
9bd65feaeb
frame: reject frames that are too big for the RAM
...
Fixes #34 .
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
977c6e7c7a
refactor: remove transmute in favor of safe code
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
c0cde68999
frame: fix integer overflow
...
This is a security fix.
Fixes #33 .
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
b93abcf900
Merge pull request #27 from snapview/websocket-config
...
Allow the configuration of `WebSocket`
7 years ago
Daniel Abramov
3a58069db2
Create helpers for config-like functions
...
As suggested by @agalakhov
7 years ago
Daniel Abramov
e1e0acd64d
Merge pull request #30 from mehcode/feature/sha1-to-sha-1
...
Switch from sha1 to sha-1
7 years ago
Daniel Abramov
fbdd412ff8
Merge branch 'master' into feature/sha1-to-sha-1
7 years ago
Daniel Abramov
1c57f0f268
Merge pull request #31 from mehcode/feature/upgrade
...
Upgrade dependency versions
7 years ago
Alexey Galakhov
82f5a2e22b
Merge pull request #29 from mehcode/feature/up-native-tls
...
Upgrade native-tls 0.1 -> 0.2
7 years ago
Ryan Leckey
93907bd70c
Upgrade dependency versions
7 years ago
Ryan Leckey
51e7ba3f39
Switch from sha1 to sha-1
7 years ago
Ryan Leckey
a496cc7e5f
Upgrade native-tls 0.1 -> 0.2
7 years ago
Alexey Galakhov
fb346ad750
Merge pull request #28 from mehcode/master
...
prepare for native-tls 0.2
7 years ago
Ryan Leckey
ef8e41f63f
prepare for native-tls 0.2
7 years ago
Daniel Abramov
715f9b0241
Bump version
7 years ago
Daniel Abramov
00303fa60c
Make the websocket configurable
7 years ago
Daniel Abramov
1f037abc34
Merge pull request #26 from tedsta/master
...
`WebSocket::write_message` only buffers one message at a time to apply back-pressure
7 years ago
Teddy DeRego
5742c822ee
WebSocket::write_message will no longer buffer unlimited messages - it will only buffer a configurable number of outbound messages. Needed for snapview/tokio-tungstenite#35 .
7 years ago
Daniel Abramov
5d5ea88b12
Merge pull request #25 from unv-annihilator/master
...
Derive Debugs
7 years ago
Sean Schwartz
66d2c15f2d
Derive Debugs
...
Deny missing debug and resolve resulting errors to satisfy:
https://rust-lang-nursery.github.io/api-guidelines/debuggability.html#all-public-types-implement-debug-c-debug
Requires updated input_buffer pushed to crates.io:
- Resolved build errors by using github version of code until new version available on crates.io
Upgrade env_logger dev-dependency to v0.5.3
- Removed unwrap call from env_logger::init() as it is no longer needed.
7 years ago
Alexey Galakhov
2d8395031b
Update dependencies and bump version.
...
Version 0.5.3 released.
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
7dc2be7eab
Update for Rust 1.23
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
4177cfac46
trivial: update dependencies
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
6f8c4e7034
Use input_buffer as separate crate.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Alexey Galakhov
65a47f95a6
Version 0.5.0 released
8 years ago
Alexey Galakhov
3091d11566
callback static dispatch
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
3a1e5dfb1f
Merge pull request #20 from snapview/request_minor
...
Minor improvements in `Request`
8 years ago
Daniel Abramov
82f33c23ae
Bump version
8 years ago
Daniel Abramov
c4013ccad3
Improve the `handshake::client::Request` structure
8 years ago
Daniel Abramov
daa7fc1d45
Merge pull request #19 from nelsonjchen/patch-1
...
Add use statements to README.md example
8 years ago
Nelson Chen
a307160e1a
Add use statements to README.md example
...
These clarify what comes from `std` and what comes from `tungstenite`.
8 years ago
Alexey Galakhov
090a7a6b2a
Version 0.4.0 released.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
e7bf80b189
Update dependencies
8 years ago