Skip to content

Commit cb8d9c7

Browse files
luqmanabrson
authored andcommitted
---
yaml --- r: 36025 b: refs/heads/try2 c: 9555ee7 h: refs/heads/master i: 36023: f45bab5 v: v3
1 parent 0a62849 commit cb8d9c7

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 781f8cbe4e5f729907d38cb4de8fc407c1bcb23e
8+
refs/heads/try2: 9555ee790f36033a1f2356cef7c115d5a588a8de
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/src/libstd/net_tcp.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ impl TcpSocket {
755755
-> future::Future<result::Result<(), TcpErrData>> {
756756
write_future(&self, raw_write_data)
757757
}
758-
pub fn getpeername() -> ip::IpAddr {
758+
pub fn get_peer_addr() -> ip::IpAddr {
759759
unsafe {
760760
if self.socket_data.ipv6 {
761761
let addr = uv::ll::ip6_addr("", 0);
@@ -1249,8 +1249,8 @@ mod test {
12491249
impl_gl_tcp_ipv4_server_and_client();
12501250
}
12511251
#[test]
1252-
fn test_gl_tcp_get_peer_name() unsafe {
1253-
impl_gl_tcp_ipv4_get_peer_name();
1252+
fn test_gl_tcp_get_peer_addr() unsafe {
1253+
impl_gl_tcp_ipv4_get_peer_addr();
12541254
}
12551255
#[test]
12561256
fn test_gl_tcp_ipv4_client_error_connection_refused() unsafe {
@@ -1279,8 +1279,8 @@ mod test {
12791279
}
12801280
#[test]
12811281
#[ignore(cfg(target_os = "linux"))]
1282-
fn test_gl_tcp_get_peer_name() unsafe {
1283-
impl_gl_tcp_ipv4_get_peer_name();
1282+
fn test_gl_tcp_get_peer_addr() unsafe {
1283+
impl_gl_tcp_ipv4_get_peer_addr();
12841284
}
12851285
#[test]
12861286
#[ignore(cfg(target_os = "linux"))]
@@ -1351,7 +1351,7 @@ mod test {
13511351
assert str::contains(actual_req, expected_req);
13521352
assert str::contains(actual_resp, expected_resp);
13531353
}
1354-
fn impl_gl_tcp_ipv4_get_peer_name() {
1354+
fn impl_gl_tcp_ipv4_get_peer_addr() {
13551355
let hl_loop = uv::global_loop::get();
13561356
let server_ip = ~"127.0.0.1";
13571357
let server_port = 8889u;
@@ -1387,8 +1387,8 @@ mod test {
13871387
let sock = result::unwrap(move connect_result);
13881388
13891389
// This is what we are actually testing!
1390-
assert net::ip::format_addr(&sock.getpeername()) == ~"127.0.0.1";
1391-
assert net::ip::get_port(&sock.getpeername()) == 8889;
1390+
assert net::ip::format_addr(&sock.get_peer_addr()) == ~"127.0.0.1";
1391+
assert net::ip::get_port(&sock.get_peer_addr()) == 8889;
13921392

13931393
// Fulfill the protocol the test server expects
13941394
let resp_bytes = str::to_bytes(~"ping");
@@ -1592,8 +1592,11 @@ mod test {
15921592
~"SERVER/WORKER: send on cont ch");
15931593
cont_ch.send(());
15941594
let sock = result::unwrap(move accept_result);
1595+
let peer_addr = sock.get_peer_addr();
15951596
log(debug, ~"SERVER: successfully accepted"+
1596-
~"connection!");
1597+
fmt!(" connection from %s:%u",
1598+
ip::format_addr(&peer_addr),
1599+
ip::get_port(&peer_addr)));
15971600
let received_req_bytes = read(&sock, 0u);
15981601
match move received_req_bytes {
15991602
result::Ok(move data) => {

0 commit comments

Comments
 (0)