mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-19 11:19:36 +00:00
Wake a WebSocket read on a pong timeout on every platform
When max_missed_pongs ran out, the heartbeat thread shut down the read side of the socket to end a read() blocked on the silent peer. On Windows that does not wake the wait, so read() stayed blocked until its read timeout and then returned Timeout. The heartbeat test never ran on Windows, so CI did not catch it. The heartbeat now sets a flag that the stream's read interrupt checks, the mechanism SSEClient::stop() uses, and WebSocketSSLStream takes the interrupt too. It is set only when a pong timeout can happen, so other connections wait as before. read() reports a timeout on a connection that has closed as Fail, since Timeout means it is still usable. Build and run the heartbeat test in the Windows jobs, and add a TLS pong timeout test.
This commit is contained in:
1 parent
801bf2e0d2
commit
696b94b5ed
4 files changed
+76
-27
No files matched your search
@@ -623,6 +623,10 @@ jobs:
|
||||
}
|
||||
if ($failed) { exit 1 }
|
||||
Write-Host "All shards passed."
|
||||
- name: Run WebSocket heartbeat test ${{ matrix.config.name }}
|
||||
if: ${{ matrix.config.run_tests }}
|
||||
working-directory: build/test
|
||||
run: ./Release/httplib-heartbeat-test.exe --gtest_color=yes
|
||||
|
||||
env:
|
||||
VCPKG_ROOT: "C:/vcpkg"
|
||||
|
||||
Reference in new issue
Block a user