Commit 620c84d
committed
Skip buffered upload handler when probe chunk detects client disconnect
Insert a b"\n" probe chunk before the real response body so that an early
client disconnect is detected before the upload handler is enqueued. Add
asyncio.sleep(0) yield point in _upload_buffered_file to let the
disconnect watcher fire first, and return early if disconnect was seen.
Includes a test covering the probe-based disconnect detection path.1 parent af85fa2 commit 620c84d
2 files changed
Lines changed: 90 additions & 5 deletions
File tree
- packages/reflex-components-core/src/reflex_components_core/core
- tests/units
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
444 | 457 | | |
445 | 458 | | |
446 | | - | |
| 459 | + | |
447 | 460 | | |
448 | 461 | | |
449 | 462 | | |
450 | 463 | | |
451 | 464 | | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
456 | 468 | | |
457 | 469 | | |
458 | 470 | | |
| |||
593 | 605 | | |
594 | 606 | | |
595 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
596 | 612 | | |
597 | 613 | | |
598 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
1379 | 1380 | | |
1380 | 1381 | | |
1381 | 1382 | | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
1382 | 1451 | | |
1383 | 1452 | | |
1384 | 1453 | | |
| |||
0 commit comments