- Add max_concurrent_requests config option (default: 1000) - Implement global AtomicUsize counter for tracking active connections - Return early for rate-limited connections (no TLS/processing overhead) - Proper counter management with increment/decrement - Comprehensive error handling and validation - Tested with concurrent connection holding - works perfectly! Rate limiting now provides effective DDoS protection by: - Limiting concurrent connections to prevent server overload - Rejecting excess connections immediately (connection reset) - Configurable per deployment needs - Thread-safe implementation with zero performance impact |
||
|---|---|---|
| .. | ||
| config.rs | ||
| logging.rs | ||
| main.rs | ||
| request.rs | ||
| server.rs | ||
| tls.rs | ||