mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-02-09 01:59:16 +08:00
updated output and doc
This commit is contained in:
@@ -86,6 +86,9 @@ ssserver -c config.json
|
||||
|
||||
List all available arguments with `-h`.
|
||||
|
||||
Default log level is `error`, override it by setting environment variable `RUST_LOG`. Please refer
|
||||
to [log crate](http://doc.rust-lang.org/log/index.html) for more detail.
|
||||
|
||||
## Notes
|
||||
|
||||
Still under developing and waiting for the final release of rust-1.0.
|
||||
|
||||
@@ -28,7 +28,7 @@ extern crate log;
|
||||
use std::sync::Arc;
|
||||
use std::io::{Listener, TcpListener, Acceptor, TcpStream};
|
||||
use std::io::{EndOfFile, TimedOut, NotConnected,
|
||||
ConnectionFailed, ConnectionRefused, ConnectionReset, ConnectionAborted};
|
||||
ConnectionFailed, ConnectionRefused, ConnectionReset, ConnectionAborted, BrokenPipe};
|
||||
use std::io::net::ip::Port;
|
||||
use std::io::net::ip::{Ipv4Addr, Ipv6Addr};
|
||||
|
||||
@@ -104,7 +104,7 @@ impl TcpRelayLocal {
|
||||
Ok(..) => {},
|
||||
Err(err) => {
|
||||
match err.kind {
|
||||
EndOfFile | TimedOut => {},
|
||||
EndOfFile | TimedOut | BrokenPipe => {},
|
||||
_ => {
|
||||
error!("Error occurs while writing to remote stream: {}", err);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ impl TcpRelayLocal {
|
||||
},
|
||||
Err(err) => {
|
||||
match err.kind {
|
||||
EndOfFile | TimedOut => {},
|
||||
EndOfFile | TimedOut | BrokenPipe => {},
|
||||
_ => {
|
||||
error!("Error occurs while reading from local stream: {}", err);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ impl TcpRelayLocal {
|
||||
Ok(..) => {},
|
||||
Err(err) => {
|
||||
match err.kind {
|
||||
EndOfFile | TimedOut => {},
|
||||
EndOfFile | TimedOut | BrokenPipe => {},
|
||||
_ => {
|
||||
error!("Error occurs while writing to local stream: {}", err);
|
||||
}
|
||||
@@ -179,7 +179,7 @@ impl TcpRelayLocal {
|
||||
},
|
||||
Err(err) => {
|
||||
match err.kind {
|
||||
EndOfFile | TimedOut => {},
|
||||
EndOfFile | TimedOut | BrokenPipe => {},
|
||||
_ => {
|
||||
error!("Error occurs while reading from remote stream: {}", err);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ extern crate log;
|
||||
use std::sync::Arc;
|
||||
use std::io::{Listener, TcpListener, Acceptor, TcpStream};
|
||||
use std::io::net::ip::{Port, IpAddr};
|
||||
use std::io::{EndOfFile, TimedOut};
|
||||
use std::io::{EndOfFile, TimedOut, BrokenPipe};
|
||||
|
||||
use config::{Config, SingleServer, MultipleServer};
|
||||
use relay::Relay;
|
||||
@@ -90,7 +90,7 @@ impl TcpRelayServer {
|
||||
Ok(..) => {},
|
||||
Err(err) => {
|
||||
match err.kind {
|
||||
EndOfFile | TimedOut => {},
|
||||
EndOfFile | TimedOut | BrokenPipe => {},
|
||||
_ => {
|
||||
error!("Error occurs while writing to local stream: {}", err);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ impl TcpRelayServer {
|
||||
},
|
||||
Err(err) => {
|
||||
match err.kind {
|
||||
EndOfFile | TimedOut => {},
|
||||
EndOfFile | TimedOut | BrokenPipe => {},
|
||||
_ => {
|
||||
error!("Error occurs while reading from remote stream: {}", err);
|
||||
}
|
||||
@@ -127,7 +127,7 @@ impl TcpRelayServer {
|
||||
},
|
||||
Err(err) => {
|
||||
match err.kind {
|
||||
EndOfFile | TimedOut => {},
|
||||
EndOfFile | TimedOut | BrokenPipe => {},
|
||||
_ => {
|
||||
error!("Error occurs while reading from client stream: {}", err);
|
||||
}
|
||||
@@ -185,8 +185,9 @@ impl Relay for TcpRelayServer {
|
||||
|
||||
let (_, addr) = match parse_request_header(header.as_slice()) {
|
||||
Ok((header_len, addr)) => (header_len, addr),
|
||||
Err(err_code) => {
|
||||
fail!("Error occurs while parsing request header: {}", err_code);
|
||||
Err(..) => {
|
||||
fail!("Error occurs while parsing request header, \
|
||||
maybe wrong crypto method or password");
|
||||
}
|
||||
};
|
||||
info!("Connecting to {}", addr);
|
||||
|
||||
Reference in New Issue
Block a user