Skip to content

Fix thread-safety and minor issues in OkHttp protocol#1862

Merged
jnioche merged 1 commit intomainfrom
okhttp-fixes
Apr 2, 2026
Merged

Fix thread-safety and minor issues in OkHttp protocol#1862
jnioche merged 1 commit intomainfrom
okhttp-fixes

Conversation

@rzo1
Copy link
Copy Markdown
Contributor

@rzo1 rzo1 commented Apr 1, 2026

  • Replace HashMap with ConcurrentHashMap for DNS timing map to prevent data races between event listener callbacks and fetch threads
  • Remove unnecessary (int) cast on long value to prevent potential truncation in content buffering loop
  • Use isEmpty() instead of size() > 0

  - Replace HashMap with ConcurrentHashMap for DNS timing map to prevent
    data races between event listener callbacks and fetch threads
  - Remove unnecessary (int) cast on long value to prevent potential
    truncation in content buffering loop
  - Use isEmpty() instead of size() > 0
@rzo1 rzo1 added this to the 3.5.2 milestone Apr 1, 2026
@jnioche jnioche merged commit c523032 into main Apr 2, 2026
2 checks passed
@jnioche jnioche deleted the okhttp-fixes branch April 2, 2026 18:12
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