Skip to content

Commit c5b87a2

Browse files
committed
Fix sgx
1 parent 4c13791 commit c5b87a2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstd/sys/sgx/net.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use fmt;
2-
use io;
2+
use io::{self, IoVec, IoVecMut};
33
use net::{SocketAddr, Shutdown, Ipv4Addr, Ipv6Addr, ToSocketAddrs};
44
use time::Duration;
55
use sys::{unsupported, Void, sgx_ineffective, AsInner, FromInner, IntoInner, TryIntoInner};
@@ -104,7 +104,7 @@ impl TcpStream {
104104
}
105105

106106
pub fn read_vectored(&self, buf: &mut [IoVecMut<'_>]) -> io::Result<usize> {
107-
let buf = match buf.get(0) {
107+
let buf = match buf.get_mut(0) {
108108
Some(buf) => buf,
109109
None => return Ok(0),
110110
};
@@ -120,7 +120,7 @@ impl TcpStream {
120120
Some(buf) => buf,
121121
None => return Ok(0),
122122
};
123-
self.read(buf)
123+
self.write(buf)
124124
}
125125

126126
pub fn peer_addr(&self) -> io::Result<SocketAddr> {

0 commit comments

Comments
 (0)