@@ -809,7 +809,9 @@ fn listen_common(host_ip: ip::IpAddr, port: uint, backlog: uint,
809
809
* A buffered wrapper that you can cast as an `io::reader` or `io::writer`
810
810
*/
811
811
pub fn socket_buf ( sock : TcpSocket ) -> TcpSocketBuf {
812
- TcpSocketBuf ( @TcpBufferedSocketData { sock : move sock, mut buf : ~[ ] , buf_off : 0 } )
812
+ TcpSocketBuf ( @TcpBufferedSocketData {
813
+ sock : move sock, mut buf : ~[ ] , buf_off : 0
814
+ } )
813
815
}
814
816
815
817
/// Convenience methods extending `net::tcp::tcp_socket`
@@ -865,19 +867,19 @@ impl TcpSocketBuf: io::Reader {
865
867
loop {
866
868
assert count < len;
867
869
868
- // If possible, copy up to `len` bytes from the internal
870
+ // If possible, copy up to `len` bytes from the internal
869
871
// `data.buf` into `buf`
870
872
let nbuffered = self . data . buf . len ( ) - self . data . buf_off ;
871
873
let needed = len - count;
872
874
if nbuffered > 0 {
873
875
unsafe {
874
- let ncopy = uint:: min ( nbuffered, needed) ;
876
+ let ncopy = uint:: min ( nbuffered, needed) ;
875
877
let dst = ptr:: mut_offset (
876
878
vec:: raw:: to_mut_ptr ( buf) , count) ;
877
879
let src = ptr:: const_offset (
878
880
vec:: raw:: to_const_ptr ( self . data . buf ) ,
879
881
self . data . buf_off ) ;
880
- ptr:: copy_memory ( dst, src, ncopy) ;
882
+ ptr:: copy_memory ( dst, src, ncopy) ;
881
883
self . data . buf_off += ncopy;
882
884
count += ncopy;
883
885
}
@@ -905,7 +907,7 @@ impl TcpSocketBuf: io::Reader {
905
907
err_data. err_name, err_data. err_msg) ;
906
908
// As we have already copied data into result buffer,
907
909
// we cannot simply return 0 here. Instead the error
908
- // should show up in a later call to read().
910
+ // should show up in a later call to read().
909
911
break ;
910
912
}
911
913
}
@@ -1872,7 +1874,8 @@ pub mod test {
1872
1874
cont_ch. send ( ( ) ) ;
1873
1875
let sock = result:: unwrap ( move accept_result) ;
1874
1876
let peer_addr = sock. get_peer_addr ( ) ;
1875
- debug ! ( "SERVER: successfully accepted connection from %s:%u" ,
1877
+ debug ! ( "SERVER: successfully accepted \
1878
+ connection from %s:%u",
1876
1879
ip:: format_addr( & peer_addr) ,
1877
1880
ip:: get_port( & peer_addr) ) ;
1878
1881
let received_req_bytes = read ( & sock, 0 u) ;
0 commit comments