Skip to content

Commit e552906

Browse files
author
Eric Reed
committed
---
yaml --- r: 142675 b: refs/heads/try2 c: f202713 h: refs/heads/master i: 142673: efc6976 142671: 21d6ed5 v: v3
1 parent 30fec55 commit e552906

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-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: 1af20163586d13f505492865f70fe9767f35a306
8+
refs/heads/try2: f202713b73559941ad64c539dc10b71655879403
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/rt/io/net/udp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl UdpStream {
8484
}
8585

8686
impl Reader for UdpStream {
87-
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
87+
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
8888
do self.as_socket |sock| {
8989
match sock.recvfrom(buf) {
9090
Some((_nread, src)) if src != self.connectedTo => Some(0),
@@ -131,7 +131,7 @@ mod test {
131131
}
132132
}
133133

134-
#[test]
134+
#[test]
135135
fn socket_smoke_test() {
136136
do run_in_newsched_task {
137137
let server_ip = next_test_ip4();

branches/try2/src/libstd/rt/uv/net.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ pub fn uv_ip4_to_ip4(addr: *sockaddr_in) -> IpAddr {
5050
let port = unsafe { ip4_port(addr) };
5151
let ip_str = str::from_bytes_slice(buf).trim_right_chars(&'\x00');
5252
let ip: ~[u8] = ip_str.split_iter('.')
53-
.transform(|s: &str| -> u8 {
54-
let x = FromStr::from_str(s);
53+
.transform(|s: &str| -> u8 {
54+
let x = FromStr::from_str(s);
5555
assert!(x.is_some());
5656
x.unwrap() })
5757
.collect();
58-
assert!(ip.len() >= 4);
58+
assert!(ip.len() >= 4);
5959
Ipv4(ip[0], ip[1], ip[2], ip[3], port as u16)
6060
}
6161

@@ -304,7 +304,7 @@ impl UdpWatcher {
304304
}
305305
}
306306
}
307-
_ => fail!() // TODO ipv6
307+
_ => fail!() // NOTE ipv6
308308
}
309309
}
310310

@@ -325,9 +325,10 @@ impl UdpWatcher {
325325
return (*alloc_cb)(suggested_size as uint);
326326
}
327327

328-
/* TODO the socket address should actually be a pointer to either a sockaddr_in or sockaddr_in6.
328+
/* NOTE the socket address should actually be a pointer to
329+
either a sockaddr_in or sockaddr_in6.
329330
In libuv, the udp_recv callback takes a struct *sockaddr */
330-
extern fn recv_cb(handle: *uvll::uv_udp_t, nread: ssize_t, buf: Buf,
331+
extern fn recv_cb(handle: *uvll::uv_udp_t, nread: ssize_t, buf: Buf,
331332
addr: *uvll::sockaddr_in, flags: c_uint) {
332333
rtdebug!("buf addr: %x", buf.base as uint);
333334
rtdebug!("buf len: %d", buf.len as int);
@@ -364,7 +365,7 @@ impl UdpWatcher {
364365
}
365366
}
366367
}
367-
_ => fail!() // TODO ipv6
368+
_ => fail!() // NOTE ipv6
368369
}
369370

370371
extern fn send_cb(req: *uvll::uv_udp_send_t, status: c_int) {
@@ -490,7 +491,9 @@ impl UdpSendRequest {
490491

491492
pub fn handle(&self) -> UdpWatcher {
492493
unsafe {
493-
NativeHandle::from_native_handle(uvll::get_udp_handle_from_send_req(self.native_handle()))
494+
NativeHandle::from_native_handle(
495+
uvll::get_udp_handle_from_send_req(
496+
self.native_handle()))
494497
}
495498
}
496499

@@ -544,7 +547,7 @@ mod test {
544547
}
545548
}
546549
547-
#[test]
550+
#[test]
548551
fn udp_bind_close() {
549552
do run_in_bare_thread() {
550553
let mut loop_ = Loop::new();
@@ -633,7 +636,7 @@ mod test {
633636
}
634637
}
635638
636-
#[test]
639+
#[test]
637640
fn udp_recv() {
638641
do run_in_bare_thread() {
639642
static MAX: int = 10;

branches/try2/src/libstd/rt/uv/uvio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl RtioUdpSocket for UvUdpSocket {
489489
let task_cell = Cell::new(task);
490490
let alloc: AllocCallback = |_| unsafe { slice_to_uv_buf(*buf_ptr) };
491491
do watcher.recv_start(alloc) |watcher, nread, _buf, addr, flags, status| {
492-
let _ = flags; // TODO add handling for partials?
492+
let _ = flags; // NOTE add handling for partials?
493493

494494
watcher.recv_stop();
495495

@@ -596,7 +596,7 @@ fn test_simple_tcp_server_and_client() {
596596
}
597597
}
598598

599-
#[test]
599+
#[test]
600600
fn test_simple_udp_server_and_client() {
601601
do run_in_newsched_task {
602602
let server_addr = next_test_ip4();

branches/try2/src/libstd/rt/uv/uvll.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ pub unsafe fn udp_send6<T>(req: *uv_udp_send_t, handle: *T, buf_in: &[uv_buf_t],
218218
return rust_uv_udp_send6(req, handle as *c_void, buf_ptr, buf_cnt, addr, cb);
219219
}
220220

221-
pub unsafe fn udp_recv_start(server: *uv_udp_t, on_alloc: uv_alloc_cb, on_recv: uv_udp_recv_cb) -> c_int {
221+
pub unsafe fn udp_recv_start(server: *uv_udp_t, on_alloc: uv_alloc_cb,
222+
on_recv: uv_udp_recv_cb) -> c_int {
222223
return rust_uv_udp_recv_start(server, on_alloc, on_recv);
223224
}
224225

branches/try2/src/rt/rust_uv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,13 @@ rust_uv_udp_bind6(uv_udp_t* server, sockaddr_in6* addr_ptr, unsigned flags) {
309309
}
310310

311311
extern "C" int
312-
rust_uv_udp_send(uv_udp_send_t* req, uv_udp_t* handle, uv_buf_t* buf_in,
312+
rust_uv_udp_send(uv_udp_send_t* req, uv_udp_t* handle, uv_buf_t* buf_in,
313313
int buf_cnt, sockaddr_in* addr_ptr, uv_udp_send_cb cb) {
314314
return uv_udp_send(req, handle, buf_in, buf_cnt, *addr_ptr, cb);
315315
}
316316

317317
extern "C" int
318-
rust_uv_udp_send6(uv_udp_send_t* req, uv_udp_t* handle, uv_buf_t* buf_in,
318+
rust_uv_udp_send6(uv_udp_send_t* req, uv_udp_t* handle, uv_buf_t* buf_in,
319319
int buf_cnt, sockaddr_in6* addr_ptr, uv_udp_send_cb cb) {
320320
return uv_udp_send6(req, handle, buf_in, buf_cnt, *addr_ptr, cb);
321321
}

0 commit comments

Comments
 (0)