[PR #2648] [MERGED] [relay-server] Move the handshake logic to separated struct #15431

Closed
opened 2026-08-05 03:07:38 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2648
Author: @pappz
Created: 9/25/2024
Status: Merged
Merged: 10/12/2024
Merged by: @pappz

Base: mainHead: relay/fix-handshake-response


📝 Commits (4)

  • e32e010 Move the handshake logic to separated struct
  • 7098ff0 Fix deprecated lint issue
  • 3a623c4 Fix error handling
  • 4a1c27b [relay-server] Relay measure auth time (#2675)

📊 Changes

3 files changed (+223 additions, -109 deletions)

View changed files

📝 relay/metrics/realy.go (+46 -6)
relay/server/handshake.go (+153 -0)
📝 relay/server/relay.go (+24 -103)

📄 Description

Describe your changes

Fix flickering unit test

Move the handshake logic to separated struct but fully keep the protocol.

  • The server will respond to the client after it is ready to process the peer
  • Preload the response messages

The authentication step is faster because do not need to marshal the response messages and this change fix flickering tests (see: NB-1047).

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/2648 **Author:** [@pappz](https://github.com/pappz) **Created:** 9/25/2024 **Status:** ✅ Merged **Merged:** 10/12/2024 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `main` ← **Head:** `relay/fix-handshake-response` --- ### 📝 Commits (4) - [`e32e010`](https://github.com/netbirdio/netbird/commit/e32e01051ce17368501d8052b417b741ef638248) Move the handshake logic to separated struct - [`7098ff0`](https://github.com/netbirdio/netbird/commit/7098ff0454ddc08c3e799862169f3e79d6766344) Fix deprecated lint issue - [`3a623c4`](https://github.com/netbirdio/netbird/commit/3a623c4deebab3c6edc44957632fac097596d54e) Fix error handling - [`4a1c27b`](https://github.com/netbirdio/netbird/commit/4a1c27b1c897839a6ab2510a404071844c3985fd) [relay-server] Relay measure auth time (#2675) ### 📊 Changes **3 files changed** (+223 additions, -109 deletions) <details> <summary>View changed files</summary> 📝 `relay/metrics/realy.go` (+46 -6) ➕ `relay/server/handshake.go` (+153 -0) 📝 `relay/server/relay.go` (+24 -103) </details> ### 📄 Description ## Describe your changes ### Fix flickering unit test Move the handshake logic to separated struct but fully keep the protocol. - The server will respond to the client after it is ready to process the peer - Preload the response messages The authentication step is faster because do not need to marshal the response messages and this change fix flickering tests (see: NB-1047). ## Issue ticket number and link ### Checklist - [x] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 03:07:38 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#15431