feat: use random request IDs instead of sequential counter
Replace the atomic counter-based request ID generation with random int64 values using math/rand/v2. This improves unpredictability and avoids potential ID collisions across client instances or restarts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
735b288504
commit
f8daa20ddd
9 changed files with 402 additions and 26 deletions
|
|
@ -12,6 +12,9 @@ var (
|
|||
|
||||
// ErrTimeout indicates a request timed out.
|
||||
ErrTimeout = errors.New("request timed out")
|
||||
|
||||
// ErrTooManyRedirects indicates the server returned too many redirects.
|
||||
ErrTooManyRedirects = errors.New("too many redirects")
|
||||
)
|
||||
|
||||
// Authentication errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue