Address race conditions in http.Request and MemGuardian#6321
Address race conditions in http.Request and MemGuardian#6321Mzack9999 merged 2 commits intoprojectdiscovery:devfrom
Conversation
WalkthroughThe changes introduce improved concurrency safety in memory guardian functions by adjusting mutex placement and usage. Additionally, HTTP request handling is updated to use cloned requests when generating curl commands and dumping requests, preventing race conditions by avoiding in-place modifications of original request objects. Changes
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (2)pkg/protocols/http/request.go (1)pkg/protocols/http/utils.go (1)🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Mzack9999
left a comment
There was a problem hiding this comment.
lgtm - mux + clones seems a good approach to prevent races from happening
Proposed changes
This PR addresses two sets of race conditions:
Example traces:
HTTP
MemGuardian
Checklist
Summary by CodeRabbit