Skip to content

Commit

Permalink
std: Create correctly-sized buffers on TCP read
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Jul 27, 2012
1 parent b50279b commit 97d59a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libstd/net_tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,8 +1118,7 @@ extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t,
log(debug, #fmt("tcp on_read_cb nread: %d", nread as int));
let reader_ch = (*socket_data_ptr).reader_ch;
let buf_base = uv::ll::get_base_from_buf(buf);
let buf_len = uv::ll::get_len_from_buf(buf);
let new_bytes = vec::unsafe::from_buf(buf_base, buf_len as uint);
let new_bytes = vec::unsafe::from_buf(buf_base, nread as uint);
comm::send(reader_ch, result::ok(new_bytes));
}
}
Expand Down

0 comments on commit 97d59a8

Please sign in to comment.