SSL session closure should be treated like EOF

This commit is contained in:
Steven Fackler 2014-03-17 21:46:05 -07:00
parent a881f7d008
commit 46cf3f0791
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ use sync::one::{Once, ONCE_INIT};
use std::cast; use std::cast;
use std::libc::{c_int, c_void, c_char}; use std::libc::{c_int, c_void, c_char};
use std::ptr; use std::ptr;
use std::io::{IoResult, IoError, OtherIoError, Stream, Reader, Writer}; use std::io::{IoResult, IoError, OtherIoError, EndOfFile, Stream, Reader, Writer};
use std::unstable::mutex::NativeMutex; use std::unstable::mutex::NativeMutex;
use std::vec_ng::Vec; use std::vec_ng::Vec;
@ -518,7 +518,7 @@ impl<S: Stream> Reader for SslStream<S> {
Ok(len) => Ok(len as uint), Ok(len) => Ok(len as uint),
Err(SslSessionClosed) => Err(SslSessionClosed) =>
Err(IoError { Err(IoError {
kind: OtherIoError, kind: EndOfFile,
desc: "SSL session closed", desc: "SSL session closed",
detail: None detail: None
}), }),