Commit 92cd588
Fix Cxx WebSocket write queue state (#58201)
Summary:
The Cxx WebSocket client can write before its handshake, drop queued pre-connect and empty frames, allow concurrent Beast writes through a check-then-set race, and retain writer ownership after errors. Gate draining on a successful connection, atomically claim the single writer, preserve empty frames, and release state on every completion.
Fixes #58200.
## Changelog:
[GENERAL] [FIXED] - Preserve buffered and empty Cxx WebSocket frames and serialize writes.
Pull Request resolved: #58201
Test Plan:
- Exact temporary localhost Boost server harness on untouched main: `Operation canceled`, both expected frames missing, exit 1.
- Fixed source harness: received the pre-connect buffered payload and empty frame, exit 0.
- Actual source and harness compiled under C++20 with `-Wall -Werror`; only a local third-party Boost/Clang deprecation was demoted.
- Repository clang-format and `git diff --check` passed.
- Temporary harness/build wiring was removed; this PR contains one runtime file only.
No UI change; screenshots are not applicable.
Reviewed By: cortinico
Differential Revision: D118266757
Pulled By: javache
fbshipit-source-id: 2881893bdcb4c6873087e5cd821a82af76e8bbb81 parent 619c8ae commit 92cd588
1 file changed
Lines changed: 14 additions & 15 deletions
Lines changed: 14 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
255 | | - | |
| 257 | + | |
256 | 258 | | |
257 | 259 | | |
258 | | - | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
265 | 266 | | |
266 | | - | |
267 | | - | |
268 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
269 | 270 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
| 271 | + | |
| 272 | + | |
275 | 273 | | |
276 | 274 | | |
277 | 275 | | |
| |||
281 | 279 | | |
282 | 280 | | |
283 | 281 | | |
284 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
288 | 290 | | |
289 | | - | |
290 | 291 | | |
291 | | - | |
292 | 292 | | |
293 | | - | |
294 | 293 | | |
295 | 294 | | |
296 | 295 | | |
| |||
0 commit comments