Repository navigation
Commit c1b9c45
fix(daemon): keep one separator spelling for the session root on Windows
On Windows cbm_canonical_path answers in the platform's native backslash
form, and the daemon stored that spelling verbatim for the client's
session_root and allowed_root (cbm_mcp_server_set_session_context) and for
the auto-index job's repo_path (application.c canonicalizes with the bare
call at three sites). Every tool handler, however, normalizes separators
after canonicalizing. One directory therefore had two names, and the exact
comparison in application_index_args_equal never matched: an explicit
index_repository request for the session root was refused as
OPTIONS_CONFLICT instead of joining the auto-index job already running for
it.
Normalize the separator spelling of both session roots in
set_session_context, and canonicalize plus normalize at the three
application.c sites through one helper, application_canonical_root().
Separators fold on every platform, so the new test
daemon_session_context_keeps_one_spelling_of_a_root binds wherever the
suite runs; it fails on main with "C:\repos\cbm" != "C:/repos/cbm".
Distilled from DeusData#1726 with co-author credit.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Co-authored-by: 刘冲 <mail@liuchong.dev>1 parent fe85a6b commit c1b9c45
3 files changed
Lines changed: 53 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
382 | 396 | | |
383 | 397 | | |
384 | 398 | | |
| |||
2355 | 2369 | | |
2356 | 2370 | | |
2357 | 2371 | | |
2358 | | - | |
| 2372 | + | |
2359 | 2373 | | |
2360 | | - | |
| 2374 | + | |
| 2375 | + | |
2361 | 2376 | | |
2362 | 2377 | | |
2363 | 2378 | | |
| |||
3372 | 3387 | | |
3373 | 3388 | | |
3374 | 3389 | | |
3375 | | - | |
| 3390 | + | |
3376 | 3391 | | |
3377 | 3392 | | |
3378 | 3393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1765 | 1765 | | |
1766 | 1766 | | |
1767 | 1767 | | |
1768 | | - | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
1769 | 1780 | | |
1770 | 1781 | | |
1771 | 1782 | | |
| |||
1776 | 1787 | | |
1777 | 1788 | | |
1778 | 1789 | | |
| 1790 | + | |
1779 | 1791 | | |
1780 | | - | |
| 1792 | + | |
1781 | 1793 | | |
1782 | 1794 | | |
1783 | 1795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
470 | 490 | | |
471 | 491 | | |
472 | 492 | | |
| |||
480 | 500 | | |
481 | 501 | | |
482 | 502 | | |
| 503 | + | |
483 | 504 | | |
0 commit comments