Naja Melan
28579b567a
Improve WebSocketState interface with Copy, PartialEq, ...
5 years ago
Naja Melan
b923ec42c0
Keep processing incoming data even after we have initiated a close handshake.
5 years ago
Artem Vorotnikov
cbf80ecc76
Edition 2018, formatting, clippy fixes
5 years ago
Daniel Abramov
e2bec4b81f
Change the way we return `Err::ConnectionClosed`
...
This way will ensure that we only return this error once. The previous
solution fixed the problem, but it did not guarantee that ""connection
closed" is returned only once.
5 years ago
Daniel Abramov
dbc8bd7b71
Fix issue with hanging server connection
5 years ago
Simon Sapin
4b1d89daf1
Update the url crate to 2.0
5 years ago
Alexey Galakhov
06308b1b3f
close: fix autobahn regression
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
b8f7d3668e
close: refine close semantics
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
6f132208ee
server: let callback return HTTP error messages
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Yusuke Sasaki
828eafd400
extract the context values from `WebSocket`
6 years ago
Daniel Abramov
c8c3d6290d
Make `Close` part of the `Message` enum
6 years ago
Evan Schwartz
da85989934
feat: impl Into<Vec<u8>> for Message
6 years ago
Alexey Galakhov
a7e87488c4
config: make config settable at runtime
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
9b0a2e0f11
trivial: split public and private impl
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
a2e122ab9e
refactor: mask: pass mask by value
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
e6ebf5ac76
trivial: style fixes
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
d2e3602170
frame: fix partial write
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
3772aaf163
chore: introduce frame size limit
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
50d1371e52
frame: cleanup frame API
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
75aa0d54f3
refactor: parse header separately from payload
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
20242d19f7
config: protocol: add message size limiting
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
a4f885f69f
protocol: improve write responsibility
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
e4a52cde05
mask: update for actual Rust version
...
Closes #35
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
cb671e1abc
trivial: improve documentation
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 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).
6 years ago
Alexey Galakhov
fdb1a0ed50
frame: reject bad opcodes early
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 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>
6 years ago
Alexey Galakhov
977c6e7c7a
refactor: remove transmute in favor of safe code
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Alexey Galakhov
c0cde68999
frame: fix integer overflow
...
This is a security fix.
Fixes #33 .
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
6 years ago
Daniel Abramov
3a58069db2
Create helpers for config-like functions
...
As suggested by @agalakhov
6 years ago
Ryan Leckey
51e7ba3f39
Switch from sha1 to sha-1
6 years ago
Ryan Leckey
ef8e41f63f
prepare for native-tls 0.2
6 years ago
Daniel Abramov
00303fa60c
Make the websocket configurable
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
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
7dc2be7eab
Update for Rust 1.23
...
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
3091d11566
callback static dispatch
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
7 years ago
Daniel Abramov
c4013ccad3
Improve the `handshake::client::Request` structure
7 years ago
Daniel Abramov
5982d4094d
Update README and examples
7 years ago
Daniel Abramov
44a15c9eab
Implements #6 (client/server headers access)
7 years ago
Daniel Abramov
f34c488217
Add basic support for examining headers ( #6 )
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
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
e3c0ec30c8
Fix close handling while read.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Alexey Galakhov
22f7df0b46
Fix possible deadlock in handshake.
...
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
8 years ago
Denis Andrejew
624f1dec1a
improve doc in protocol/mod.rs
8 years ago