Commit Graph
76 Commits
Author SHA1 Message Date
jpirnay 966ba71a90 Embrace utf8-counting helpers 2026-04-20 20:16:40 +02:00
jpirnay 29284c85c9 Review comments 2026-04-20 13:28:56 +02:00
jpirnay 3fb9ac9e29 Finetuning 2 2026-04-20 13:15:05 +02:00
jpirnay fd72941cd4 Treat body[1] properly 2026-04-20 11:53:46 +02:00
jpirnay 38e90a818b Make json field check more lenient 2026-04-20 11:39:21 +02:00
jpirnay ec90d46a02 Fix omission 2026-04-20 10:44:34 +02:00
jpirnay d6292920d9 Picking up some itsthisjutin ideas 2026-04-19 19:03:43 +02:00
jpirnay 0a4dabef45 Add debug info 2026-04-17 21:44:36 +02:00
jpirnay 6537a368ed Add retry on esp_err_http_eagain 2026-04-14 10:40:05 +02:00
jpirnay a03d232dd3 Finalize implementation 2026-04-13 20:24:28 +02:00
jpirnay 1c3ba11563 Attempt at closing reader and sync 2026-04-13 19:10:32 +02:00
jpirnay e768db2ceb Less memory 2026-04-13 17:54:39 +02:00
jpirnay b907aa8ff7 Minor adjustment for BOM strings 2026-04-13 11:48:02 +02:00
jpirnay 398a25c417 Review comment 2026-04-13 11:38:52 +02:00
jpirnay 03b3e1e5b7 Provide a clearer message for TLS 1.3 cases 2026-04-13 11:32:19 +02:00
jpirnay 5c567b0a72 Address upstream review comments 2026-04-13 11:15:20 +02:00
jpirnay 6d9c5b592b Review comment 2026-04-11 20:52:21 +02:00
jpirnay 548fd61e99 Add redirection to KoReaderSyncs (eg behind Duckdns or others) 2026-04-11 20:31:34 +02:00
jpirnay 019dde09e1 Deal with empty responses 2026-04-08 14:54:26 +02:00
jpirnay dcc1bbc2fa Address review comments 2026-04-07 22:28:32 +02:00
jpirnay 6dd905fb5a Split menu actions for smaller footprint 2026-04-07 21:39:03 +02:00
jpirnay abbf69649e Revert "Merge pull request #25 from jpirnay/fix-pr1582" and refactor koreader 2026-04-07 20:24:51 +02:00
jpirnay a67799b04c Extend error messages 2026-04-07 10:56:56 +02:00
jpirnay b9cf57f7f4 Koreader Sync: Fix XPath index comparison 2026-04-04 15:54:55 +02:00
jpirnay 19aa643079 yaclf 2026-04-01 13:57:06 +02:00
jpirnay fea600dd7e Fix parent-element “exact” preemption 2026-04-01 13:32:55 +02:00
jpirnay e1fd631ced Review implied changes 2026-04-01 11:14:53 +02:00
jpirnay 55fbe1817e Merge branch 'feat-koysnc-xpath' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-04-01 10:46:04 +02:00
jpirnay ed02f20c36 yaclf 2026-04-01 10:41:56 +02:00
jpirnay fb4d0c6572 Refactor and extend docs 2026-04-01 10:38:02 +02:00
jpirnay 560a108921 KOReaderSync: add text-node offset mapping and trim debug noise 2026-04-01 10:15:05 +02:00
jpirnay 9cbe3bfc4d KOReaderSync: add text-node offset mapping and trim debug noise 2026-04-01 10:10:31 +02:00
jpirnay c4186abb61 Merge branch 'feat-koysnc-xpath' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-31 12:58:22 +02:00
jpirnay 12ad974dc7 Address /text()[N].M cases 2026-03-31 12:58:00 +02:00
jpirnay d7c4471864 yaclf 2026-03-30 10:07:10 +02:00
jpirnay 08f05b7a5b Fix br.0 indexing issue 2026-03-28 11:04:01 +01:00
jpirnay 420110b733 Fix index issue 2026-03-28 11:01:22 +01:00
jpirnay 5745e598e3 fix: migrate KOSync registerUser to esp_http_client 2026-03-25 20:22:01 +01:00
trilwu 08739746f8 style: fix clang-format alignment and log allocation failure
Address CI clang-format check and CodeRabbit review feedback:
- Fix parameter alignment (one extra space)
- Log warning when response buffer allocation fails

(cherry picked from commit 3900ea1feb017c07bd5e38da0b471fe623ec506e)
2026-03-25 20:19:46 +01:00
trilwu 10ea651e26 fix: use esp_http_client for KOSync to prevent TLS OOM on ESP32-C3
The Arduino WiFiClientSecure allocates 16KB TLS buffers by default,
which exhausts the ESP32-C3's limited heap (~46KB free after WiFi)
during the TLS handshake. This causes KOReader sync to fail silently
or crash on HTTPS servers (including the default sync.koreader.rocks).

Replace WiFiClientSecure/HTTPClient with esp_http_client (ESP-IDF),
which supports configurable buffer sizes. Use 2KB TLS buffers — more
than sufficient for KOSync's tiny JSON payloads (<1KB).

Also:
- Use esp_crt_bundle for proper TLS certificate verification instead
  of setInsecure()
- Strip trailing slashes from server URL to prevent double-slash in
  API paths
- Add lastHttpCode for diagnostics
- Add heap logging to help debug memory issues

Fixes #581

(cherry picked from commit 835abc19ff14fcbea8571ccb0dfd8d21e882b84c)
2026-03-25 20:19:46 +01:00
jpirnay e0ee59cbdf Merge branch 'feat-kosync-onlongpress' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-23 12:42:23 +01:00
jpirnay 75350b0a3e Incorporate koreader registration 2026-03-23 12:35:01 +01:00
jpirnayandClaude Opus 4.6 fd70b3a231 Add paragraph index LUT for accurate KOReader position sync
Store per-page paragraph indices in section cache to enable precise
XPath-to-page and page-to-XPath mapping without reparsing XHTML.

Forward path (upload): generates XPath directly from paragraph LUT
instead of byte-offset estimation, eliminating drift in chapters
with non-uniform content density.

Reverse path (download): resolves incoming KOReader XPath p[N] to
the exact page via paragraph LUT lookup.

Paragraph counter counts all <p> elements including display:none
to match ChapterXPathIndexer and crengine's standard XPath counting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 12:29:30 +01:00
jpirnayandClaude Opus 4.6 b625b8bd26 Add paragraph index LUT for accurate KOReader position sync
Store per-page paragraph indices in section cache to enable precise
XPath-to-page and page-to-XPath mapping without reparsing XHTML.

Forward path (upload): generates XPath directly from paragraph LUT
instead of byte-offset estimation, eliminating drift in chapters
with non-uniform content density.

Reverse path (download): resolves incoming KOReader XPath p[N] to
the exact page via paragraph LUT lookup.

Paragraph counter counts all <p> elements including display:none
to match ChapterXPathIndexer and crengine's standard XPath counting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 12:29:26 +01:00
jpirnay dccb82642d Merge branch 'feat-koysnc-xpath' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-21 20:10:23 +01:00
jpirnay 5b710e960f Fix OOM 2026-03-21 20:04:03 +01:00
jpirnay b08b576ddf Merge branch 'feat-koysnc-xpath' of https://github.com/jpirnay/crosspoint-reader into mybuild 2026-03-21 09:04:41 +01:00
jpirnay beeea38721 Remove cache - caused OOM in certain scenarios 2026-03-21 09:04:03 +01:00
jpirnay b7cb9517ea Fix xpath case issue 2026-03-20 11:13:36 +01:00
jpirnay 14d1c14137 Fix xpath case issue 2026-03-20 11:12:19 +01:00