Skip to content

Commit dd32239

Browse files
committed
---
yaml --- r: 146871 b: refs/heads/try2 c: e9a1869 h: refs/heads/master i: 146869: c5612ee 146867: 64f92c9 146863: 3e458d7 v: v3
1 parent 3a4e3d1 commit dd32239

File tree

4 files changed

+35
-18
lines changed

4 files changed

+35
-18
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: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9521551b4710805674ad6c1755bef4e76784db02
8+
refs/heads/try2: e9a1869a5f4164d5311963b1b25b05f003d43699
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/etc/combine-tests.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,28 @@
55
# can run it "fast": spawning zillions of windows processes is our major build
66
# bottleneck (and it doesn't hurt to run faster on other platforms as well).
77

8-
import sys, os, re, codecs
8+
import sys
9+
import os
10+
import codecs
11+
912

1013
def scrub(b):
11-
if sys.version_info >= (3,) and type(b) == bytes:
12-
return b.decode('ascii')
13-
else:
14-
return b
14+
if sys.version_info >= (3,) and type(b) == bytes:
15+
return b.decode('ascii')
16+
else:
17+
return b
1518

1619
src_dir = scrub(os.getenv("CFG_SRC_DIR"))
1720
if not src_dir:
18-
raise Exception("missing env var CFG_SRC_DIR")
21+
raise Exception("missing env var CFG_SRC_DIR")
1922

2023
run_pass = os.path.join(src_dir, "src", "test", "run-pass")
2124
run_pass = os.path.abspath(run_pass)
2225
stage2_tests = []
2326

2427
for t in os.listdir(run_pass):
2528
if t.endswith(".rs") and not (
26-
t.startswith(".") or t.startswith("#") or t.startswith("~")):
29+
t.startswith(".") or t.startswith("#") or t.startswith("~")):
2730
f = codecs.open(os.path.join(run_pass, t), "r", "utf8")
2831
s = f.read()
2932
if not ("xfail-test" in s or
@@ -41,10 +44,11 @@ def scrub(b):
4144
c.write("// AUTO-GENERATED FILE: DO NOT EDIT\n")
4245
c.write("#[link(name=\"run_pass_stage2\", vers=\"0.1\")];\n")
4346
c.write("#[feature(globs, macro_rules, struct_variant, managed_boxes)];\n")
47+
c.write("#[allow(attribute_usage)];\n")
4448
for t in stage2_tests:
4549
p = os.path.join(run_pass, t)
4650
p = p.replace("\\", "\\\\")
47-
c.write("#[path = \"%s\"]" % p);
51+
c.write("#[path = \"%s\"]" % p)
4852
c.write("pub mod t_%d;\n" % i)
4953
i += 1
5054
c.close()
@@ -56,10 +60,10 @@ def scrub(b):
5660
d.write("extern mod extra;\n")
5761
d.write("extern mod run_pass_stage2;\n")
5862
d.write("use run_pass_stage2::*;\n")
59-
d.write("use std::io;\n");
60-
d.write("use std::io::Writer;\n");
61-
d.write("fn main() {\n");
62-
d.write(" let mut out = io::stdout();\n");
63+
d.write("use std::io;\n")
64+
d.write("use std::io::Writer;\n")
65+
d.write("fn main() {\n")
66+
d.write(" let mut out = io::stdout();\n")
6367
i = 0
6468
for t in stage2_tests:
6569
p = os.path.join("test", "run-pass", t)

branches/try2/src/librustuv/addrinfo.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ pub fn accum_addrinfo(addr: &Addrinfo) -> ~[ai::Info] {
184184
}
185185
}
186186

187-
#[cfg(test)]
187+
// cannot give tcp/ip permission without help of apk
188+
#[cfg(test, not(target_os="android"))]
188189
mod test {
189190
use std::io::net::ip::{SocketAddr, Ipv4Addr};
190191
use super::*;
191192
use super::super::local_loop;
192193

193194
#[test]
194-
#[ignore(cfg(target_os="android"))] // cannot give tcp/ip permission without help of apk
195195
fn getaddrinfo_test() {
196196
match GetAddrInfoRequest::run(local_loop(), Some("localhost"), None, None) {
197197
Ok(infos) => {
@@ -208,4 +208,12 @@ mod test {
208208
Err(e) => fail!("{:?}", e),
209209
}
210210
}
211+
212+
#[test]
213+
fn issue_10663() {
214+
// Something should happen here, but this certainly shouldn't cause
215+
// everything to die. The actual outcome we don't care too much about.
216+
GetAddrInfoRequest::run(local_loop(), Some("irc.n0v4.com"), None,
217+
None);
218+
}
211219
}

branches/try2/src/librustuv/net.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,17 @@ pub fn sockaddr_to_socket_addr(addr: *sockaddr) -> SocketAddr {
5959
fail!("unknown address?");
6060
};
6161
let ip_name = {
62+
// apparently there's an off-by-one in libuv?
63+
let ip_size = ip_size + 1;
6264
let buf = vec::from_elem(ip_size + 1 /*null terminated*/, 0u8);
6365
let buf_ptr = vec::raw::to_ptr(buf);
64-
if uvll::rust_is_ipv4_sockaddr(addr) == 1 {
65-
uvll::uv_ip4_name(addr, buf_ptr as *c_char, ip_size as size_t);
66+
let ret = if uvll::rust_is_ipv4_sockaddr(addr) == 1 {
67+
uvll::uv_ip4_name(addr, buf_ptr as *c_char, ip_size as size_t)
6668
} else {
67-
uvll::uv_ip6_name(addr, buf_ptr as *c_char, ip_size as size_t);
69+
uvll::uv_ip6_name(addr, buf_ptr as *c_char, ip_size as size_t)
70+
};
71+
if ret != 0 {
72+
fail!("error parsing sockaddr: {}", UvError(ret).desc());
6873
}
6974
buf
7075
};

0 commit comments

Comments
 (0)