mirror of https://github.com/mohtar/rust-fastcgi
Properly close TCP socket. Fix #4
This commit is contained in:
parent
576a378454
commit
3fbd635807
|
@ -100,6 +100,9 @@ impl Socket {
|
|||
|
||||
impl Drop for Socket {
|
||||
fn drop(&mut self) {
|
||||
unsafe { c::shutdown(self.inner, c::SHUT_WR); }
|
||||
let mut buf = Vec::new();
|
||||
self.read_to_end(&mut buf).ok();
|
||||
unsafe { c::close(self.inner); }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue