Commit 553636c
fix(btsp): keep connection alive for NDJSON after JSON-line handshake
After a JSON-line BTSP handshake completes, both the pure JSON-RPC
server and daemon CLI were falling through to the binary BTSP framing
loop (read_frame/write_frame with 4-byte length prefix). Clients that
performed a JSON-line handshake expect NDJSON on the same connection,
so the first JSON-RPC call hit a protocol mismatch and got reset.
Now both handlers enter NDJSON mode (newline-delimited JSON-RPC) after
a successful JSON-line BTSP handshake, matching the plaintext path.
The tarpc path is unaffected — it correctly uses LengthDelimitedCodec
after handshake. Fixes "connection reset" / "Broken pipe" on
toadstool.liveness and health:Node:compute reported by primalSpring.
Made-with: Cursor1 parent 3edd813 commit 553636c
2 files changed
Lines changed: 27 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
316 | | - | |
317 | 315 | | |
318 | 316 | | |
319 | | - | |
| 317 | + | |
320 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| |||
326 | 328 | | |
327 | 329 | | |
328 | 330 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | 331 | | |
334 | 332 | | |
335 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
336 | 352 | | |
337 | 353 | | |
338 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | | - | |
309 | 307 | | |
310 | 308 | | |
311 | | - | |
| 309 | + | |
312 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
313 | 314 | | |
314 | 315 | | |
315 | 316 | | |
| |||
0 commit comments