updated error handling, README

This commit is contained in:
Y. T. Chung
2014-10-21 03:48:24 +08:00
parent cba8dad83a
commit f4edb2ec5f
2 changed files with 24 additions and 5 deletions

View File

@@ -60,3 +60,14 @@ Currently implementation can only be built by rust-0.12-dev. It supports the fol
* CONNECT command
* AES-(128|192|256)-CFB crypto algorithm
## TODO
* Documentation
* UDP_ASSOCIATION command
* BIND command
* Sock5 authentication
* Extend configuration format
* Fully testing on server
* Multiple worker
* User management

View File

@@ -4,7 +4,7 @@ extern crate log;
use std::sync::Arc;
use std::io::{Listener, TcpListener, Acceptor, TcpStream};
use std::io::{EndOfFile, TimedOut};
use std::io::{EndOfFile, TimedOut, NotConnected};
use config::Config;
@@ -79,7 +79,9 @@ impl TcpRelayLocal {
match local_stream.close_read() {
Ok(..) => (),
Err(err) => {
error!("Error occurs while closing local read: {}", err);
if err.kind != NotConnected {
error!("Error occurs while closing local read: {}", err);
}
}
}
break
@@ -96,7 +98,9 @@ impl TcpRelayLocal {
match remote_stream.close_write() {
Ok(..) => (),
Err(err) => {
error!("Error occurs while closing remote write: {}", err);
if err.kind != NotConnected {
error!("Error occurs while closing remote write: {}", err);
}
}
}
break
@@ -131,7 +135,9 @@ impl TcpRelayLocal {
match remote_stream.close_read() {
Ok(..) => (),
Err(err) => {
error!("Error occurs while closing remote read: {}", err);
if err.kind != NotConnected {
error!("Error occurs while closing remote read: {}", err);
}
}
}
break
@@ -148,7 +154,9 @@ impl TcpRelayLocal {
match local_stream.close_write() {
Ok(..) => (),
Err(err) => {
error!("Error occurs while closing remote write: {}", err);
if err.kind != NotConnected {
error!("Error occurs while closing remote write: {}", err);
}
}
}
break