Drop for PySSLSocket#6791
Conversation
📝 WalkthroughWalkthroughA Drop implementation was added to PySSLSocket for resource cleanup upon drop, and shutdown behavior was modified so reads and writes error only after shutdown completion rather than blocking during state transitions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Comment |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/stdlib/src/ssl.rs (1)
3679-3688: Block writes once shutdown has started.
Afterclose_notifyis sent, sending application data violates TLS. The current check allows writes duringSentCloseNotify. Consider blocking any write once shutdown is initiated.🐛 Proposed fix
- if *self.shutdown_state.lock() == ShutdownState::Completed { + let shutdown_state = *self.shutdown_state.lock(); + if shutdown_state != ShutdownState::NotStarted { return Err(vm .new_os_subtype_error( PySSLError::class(&vm.ctx).to_owned(), None, "cannot write after shutdown", ) .upcast()); }
Sorry, something went wrong.
6a064aa
into
RustPython:main
Jan 19, 2026
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.