19 Commits (master)

Author SHA1 Message Date
Jessie Murray 6b090b4ede
Large refactoring of WS code
1. Introduce ws_client struct
2. Handle all communications from websocket.c for WS clients
3. Always use a dedicated Redis connection for WS clients
4. Add rbuf & wbuf evbuffers for incoming & outgoing WS data
5. Use event_base_once to control R/W events
6. WS test: make sure to read complete HTTP response
3 years ago
Jessie Murray 8d1b6c40f8
Fix instant vs overall rate in websocket C test
The overall rate was incorrect when using non-default intervals. Also
simplify the code using plain nanosecond values, and fix the rate for
the last event which was based on the number of sleeps instead of the
actual time elapsed.
3 years ago
Jessie Murray 1204f66ec1
Add progress thread w/ custom interval for WS test
* Start progress thread that reports once a second by default
* Customizable rate with [--interval|-i]
* Portable semaphore tested on Linux & macOS
3 years ago
Jessie Murray 69be409b87
PR review: unused code, comment style 3 years ago
Jessie Murray 3984fb968f
Validate Sec-WebSocket-Accept in WS test
1. Generate random WS connection key
2. Read headers returned in WS connection (upgrade) response
3. Validate Sec-WebSocket-Accept return value from webdis

Tested by introducing an artificial error in webdis, reported as
expected.
3 years ago
Jessie Murray 657197f737
websocket test: make WS mask configurable 3 years ago
Jessie Murray fd8f0b16e0
websocket test: remove special single-threaded mode 3 years ago
Jessie Murray 9a758c6bcf
websocket test: make client sockets non-blocking 3 years ago
Jessie Murray 8141c00ab7
websocket test: formatting/indentation 3 years ago
Jessie Murray b5b76c9c8f
Reduce default number of websocket messages to test for
2,500 per client with 4 clients: 10,000 total
3 years ago
Jessie Murray 665fc19126
Add max execution time to tests/websocket.c
* Add --max-time in seconds
* Break client loop when elapsed
3 years ago
Jessie Murray 2576a1606d
Websocket test: clean up usage(), exit code
* Better usage() help page
* Do not submit another frame once we've sent all we needed
3 years ago
Jessie Murray b0740d0c87
Major update of websocket test
1. Switch to evbuffer for correct handling of partial writes
2. Implement WS state machine in each worker
3. Clean up debug logging
4. Add detailed network log messages to help find WS issues
5. Switch to getopt_long
3 years ago
Jessie Murray 0a27fc7e10
More progress on evbuffer-based WS client test 3 years ago
Jessie Murray c46b85ab7a
First attempt at fixing the websocket test 3 years ago
Nicolas Favre-Felix 1589b77da9
Clean up empty indented lines 4 years ago
Nicolas Favre-Felix fb7d5b8429 Cleanup. 14 years ago
Nicolas Favre-Felix 21c4413d0d cleanup. 14 years ago
Nicolas Favre-Felix 5b7aa50e62 Partial rewrite, adding WebSockets, threads, pool. 14 years ago