Skip to content

Commit b71970f

Browse files
author
Eric Reed
committed
---
yaml --- r: 63447 b: refs/heads/snap-stage3 c: 7e022c5 h: refs/heads/master i: 63445: 6267ff6 63443: 4a665fd 63439: 735f326 v: v3
1 parent 23438c0 commit b71970f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: b51d1885befe2779fa3fdc9e2a9bafa4ef3d5cf2
4+
refs/heads/snap-stage3: 7e022c590fb0fb6083be7825df90045505e6fe47
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/rt/uv/net.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ fn ip4_as_uv_ip4<T>(addr: IpAddr, f: &fn(*sockaddr_in) -> T) -> T {
3838
}
3939
}
4040

41+
pub fn uv_ip4_to_ip4(addr: *sockaddr_in) -> IpAddr {
42+
let ip4_size = 16;
43+
let buf = vec::from_elem(ip4_size, 0u8);
44+
unsafe { ip4_name(addr, &buf[0], ip4_size as u64) };
45+
let port = unsafe { ip4_port(addr) };
46+
Ipv4(buf[0], buf[1], buf[2], buf[3], port as u16)
47+
}
48+
4149
// uv_stream t is the parent class of uv_tcp_t, uv_pipe_t, uv_tty_t
4250
// and uv_file_t
4351
pub struct StreamWatcher(*uvll::uv_stream_t);

0 commit comments

Comments
 (0)