Commit 29cb714
Use the block size determined by asyncssh if nothing is specified (#52)
* Use server-reported block sizes for SSHFile when none is specified
When the server implements limits@openssh.com, use its max_read_len /
max_write_len as the block size for opened files (OpenSSH reports
255 KiB, roughly 3x-5x the previous defaults, measured ~3x faster
reads in #49). When the extension is not supported, asyncssh
synthesizes 16 KiB floors with a zero max_packet_len -- keep the tuned
48 KiB / 240 KiB defaults there instead of degrading to the floors.
An explicitly passed block_size wins as before.
Also drop a shadowed duplicate seekable() definition left over from
merging #50 and #51.
Fixes #49
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* tests: cover SSHFile block size selection
test_determine_block_size pins all three cases (server-reported
limits, synthesized floors with zero max_packet_len, asyncssh without
the limits API); test_open_block_size checks end to end that a server
without limits@openssh.com keeps the tuned defaults and that an
explicit block_size wins.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Ivan Shcheklein <shcheklein@gmail.com>1 parent df852af commit 29cb714
2 files changed
Lines changed: 76 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 28 | | |
44 | 29 | | |
45 | 30 | | |
46 | 31 | | |
47 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
48 | 35 | | |
49 | 36 | | |
50 | 37 | | |
51 | 38 | | |
52 | 39 | | |
53 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
65 | 78 | | |
| |||
80 | 93 | | |
81 | 94 | | |
82 | 95 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | 96 | | |
87 | 97 | | |
88 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
339 | 386 | | |
340 | 387 | | |
341 | 388 | | |
| |||
0 commit comments