Skip to content

Commit 54bece3

Browse files
author
Eric Reed
committed
---
yaml --- r: 66028 b: refs/heads/master c: 7e022c5 h: refs/heads/master v: v3
1 parent eba0fcd commit 54bece3

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,5 +1,5 @@
11
---
2-
refs/heads/master: b51d1885befe2779fa3fdc9e2a9bafa4ef3d5cf2
2+
refs/heads/master: 7e022c590fb0fb6083be7825df90045505e6fe47
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/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)