-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shadowsocks2022 Client Implementation Improvements #2770
Shadowsocks2022 Client Implementation Improvements #2770
Conversation
xiaokangwang
commented
Nov 20, 2023
- Added UDP Replay Detection
- Added UDP Processor State Cache
- Added More Detailed Output for Time Difference Error
00ac171
to
e6ff22a
Compare
1. Added UDP Replay Detection 2. Added UDP Processor State Cache 3. Added More Detailed Output for Time Difference Error
e6ff22a
to
bc27c9d
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2770 +/- ##
==========================================
- Coverage 36.97% 36.87% -0.10%
==========================================
Files 671 671
Lines 39685 39792 +107
==========================================
Hits 14673 14673
- Misses 23391 23497 +106
- Partials 1621 1622 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of contention on sessionMap
. The lock is taken once per packet on the encode path, and twice per packet on the decode path.
1. Replaced Mutex with RWMutex for reduced lock contention 2. Added per server session tracking of decryption cache and anti-replay window
I have:
It is ready for another round of review. |
} | ||
for _, key := range expiredServerSessionID { | ||
delete(c.trackedServerSessionID, key) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to delete k-v pairs from a map while iterating over it. There's no need to cache the keys to delete in a separate slice.
The replay window during a server session change is only 60 seconds. Why does it cache the state for 125 seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have adjusted this value to 65 seconds and removed mark and remove for Server Session ID.
1. Adjust server session track time 2. Increase per session buffer to 128
1. Fix client crash when EIH is not enabled 2. Fix client log contains non-human-friendly content
1. Remove mark and remove for trackedSessions
I have got another round of edit. Please have a look and please let me know if there is any other suggestions before you consider this implementation spec compliant. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for addressing my feedback. LGTM now.
1. Fixed packet size uint16 overflow issue
1. Fixed packet size uint16 overflow issue