Skip to content

calibre: rework connection setup - #13704

Merged
pazos merged 2 commits into
koreader:masterfrom
benoit-pierre:pr/improve_calibre_support
May 5, 2025
Merged

pazos merged 2 commits into
koreader:masterfrom
benoit-pierre:pr/improve_calibre_support

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented May 1, 2025 •

Copy link
Copy Markdown
Member

Faster and with better UI:

  • roughly halve a successful connection setup
  • drop manual & temporary TCP connection before the real ZMQ one:
    • it slows down the total connection time
    • it's actually counted by calibre as a failed connection attempt: after 5 consecutive failures from the same IP, calibre ignore further connections, with no feedback to the user, except an error trace, until the wireless server is restarted
    • avoid unconditional 1s delay before checking for authentication failure
  • "searching" & "connecting" (cancellable) dialogs
  • stop connection on quit / restart

NOTE: I actually kept the temporary TCP connection check, but after a failed connection attempt (timeout getting replies from the server), to get a better error message (failure in hostname resolution, connection refused, etc…)

Before:

calibre_before

calibre_before.mp4

After:

calibre_after

calibre_after.mp4

This change is Reviewable

Clear socket & poller field after `stop` so we get a clear
segfault when attempting to keep using the queue (including
another call to `stop`), instead of undefined behavior.
Faster and with better UI:

- roughly halve a successful connection setup
- drop manual & temporary TCP connection before the real ZMQ one:
  - it slows down the total connection time
  - it's actually counted by calibre as a failed connection attempt:
    after 5 consecutive failures from the same IP, calibre ignore
    further connections, with no feedback to the user, except an
    error trace, until the wireless server is restarted
- avoid unconditional 1s delay before checking for authentication failure
- "searching" & "connecting" (cancellable) dialogs
- stop connection on quit / restart

@Frenzie Frenzie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me, but mind I don't use calibre and I don't know much about this plugin so @pazos might want to take a look.

Comment thread plugins/calibre.koplugin/wireless.lua Resolved
Comment thread plugins/calibre.koplugin/wireless.lua Resolved
@pazos
pazos merged commit 8fef5c1 into koreader:master May 5, 2025
@benoit-pierre
benoit-pierre deleted the pr/improve_calibre_support branch May 5, 2025 16:23
benoit-pierre added a commit to benoit-pierre/koreader that referenced this pull request May 16, 2025
Frenzie pushed a commit that referenced this pull request May 16, 2025
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants