Skip to content

sdk(local_relay): InnerLocalRelay::handle_connection take conn permit before handshake - #1458

Merged
yukibtc merged 1 commit into
nostrdevkit:masterfrom
TheAwiteb:local-relay-run-take-conn-permit-first
Sep 19, 2026
Merged

yukibtc merged 1 commit into
nostrdevkit:masterfrom
TheAwiteb:local-relay-run-take-conn-permit-first

Conversation

@TheAwiteb

Copy link
Copy Markdown
Member

I don't really think any relay use handle_connection, as I know all of them use handle_upgraded_connection, which take an already upgraded connection. But just in case a prodaction realy used it.

Checklist

  • I followed the contribution guidelines
  • I updated the relevant CHANGELOG.md (if applicable)
  • I understand and can explain all code in this PR

@TheAwiteb
TheAwiteb requested a review from yukibtc as a code owner August 20, 2026 13:19
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

TheAwiteb added a commit to TheAwiteb/nostr that referenced this pull request Aug 21, 2026
Returns the number of remaining connections the relay can handle.

Useful for relays that use `LocalRelay::take_connection` with an already
upgraded connection, avoiding CPU waste on connections that would be
rejected due to capacity limits.

Refs nostrdevkit#1458

Signed-off-by: Awiteb <a@4rs.nl>
…it before handshake

I don't really think any relay use `handle_connection`, as I know all
of them use `handle_upgraded_connection`, which take an already upgraded
connection. But just in case a prodaction realy used it.

Pull-Request: nostrdevkit#1458
Signed-off-by: Awiteb <a@4rs.nl>
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
@yukibtc
yukibtc force-pushed the local-relay-run-take-conn-permit-first branch from 25ca2d2 to 1e855b2 Compare September 19, 2026 06:59
@yukibtc
yukibtc merged commit 1e855b2 into nostrdevkit:master Sep 19, 2026
42 checks passed
yukibtc pushed a commit to TheAwiteb/nostr that referenced this pull request Sep 19, 2026
Returns the number of remaining connections the relay can handle.

Useful for relays that use `LocalRelay::take_connection` with an already
upgraded connection, avoiding CPU waste on connections that would be
rejected due to capacity limits.

Refs nostrdevkit#1458

Pull-Request: nostrdevkit#1459
Signed-off-by: Awiteb <a@4rs.nl>
yukibtc pushed a commit that referenced this pull request Sep 19, 2026
…it before handshake

I don't really think any relay use `handle_connection`, as I know all
of them use `handle_upgraded_connection`, which take an already upgraded
connection. But just in case a prodaction realy used it.

Pull-Request: #1458
Signed-off-by: Awiteb <a@4rs.nl>
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
(cherry picked from commit 1e855b2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants