mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-06 16:14:11 +00:00
Lower log level of early EOF while handshaking
- ref #490 - Enable clippy on github action
This commit is contained in:
@@ -9,11 +9,17 @@ on:
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUSTFLAGS: "-Ctarget-feature=+aes,+ssse3"
|
||||
RUST_LOG: "shadowsocks=trace"
|
||||
RUST_LOG: "trace"
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
buid-test-check:
|
||||
strategy:
|
||||
matrix:
|
||||
platform:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
- macos-latest
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -28,60 +34,19 @@ jobs:
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
components: clippy
|
||||
- name: Build & Test (Default)
|
||||
run: cargo test --verbose --no-fail-fast
|
||||
- name: Build & Test (--no-default-features)
|
||||
run: cargo test --verbose --no-default-features --no-fail-fast
|
||||
- name: Build with All Features Enabled
|
||||
run: cargo build --verbose --features "local-redir local-dns dns-over-tls dns-over-https stream-cipher"
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/cache@v2
|
||||
- name: Clippy Check
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
- name: Install Rust nightly
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
- name: Build & Test (Default)
|
||||
run: cargo test --verbose --no-fail-fast
|
||||
- name: Build & Test (--no-default-features)
|
||||
run: cargo test --verbose --no-default-features --no-fail-fast
|
||||
- name: Build with All Features Enabled
|
||||
run: cargo build --verbose --features "local-dns dns-over-tls dns-over-https stream-cipher"
|
||||
|
||||
build-macos:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install GNU tar
|
||||
run: |
|
||||
brew install gnu-tar
|
||||
# echo "::add-path::/usr/local/opt/gnu-tar/libexec/gnubin"
|
||||
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
- name: Install Rust nightly
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
- name: Build & Test (Default)
|
||||
run: cargo test --verbose --no-fail-fast
|
||||
- name: Build & Test (--no-default-features)
|
||||
run: cargo test --verbose --no-default-features --no-fail-fast
|
||||
- name: Build with All Features Enabled
|
||||
run: cargo build --verbose --features "local-redir local-dns dns-over-tls dns-over-https stream-cipher"
|
||||
name: clippy-${{ matrix.platform }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: |
|
||||
--all-features --verbose -- -Z macro-backtrace
|
||||
-W clippy::absurd_extreme_comparisons
|
||||
-W clippy::erasing_op
|
||||
|
||||
@@ -13,7 +13,7 @@ use shadowsocks::{
|
||||
crypto::v1::CipherKind,
|
||||
net::{AcceptOpts, TcpStream as OutboundTcpStream},
|
||||
relay::{
|
||||
socks5::Address,
|
||||
socks5::{Address, Error as Socks5Error},
|
||||
tcprelay::{
|
||||
utils::{copy_from_encrypted, copy_to_encrypted},
|
||||
ProxyServerStream,
|
||||
@@ -89,6 +89,13 @@ impl TcpServerClient {
|
||||
async fn serve(mut self) -> io::Result<()> {
|
||||
let target_addr = match Address::read_from(&mut self.stream).await {
|
||||
Ok(a) => a,
|
||||
Err(Socks5Error::IoError(ref err)) if err.kind() == ErrorKind::UnexpectedEof => {
|
||||
debug!(
|
||||
"handshake failed, received EOF before a complete target Address, peer: {}",
|
||||
self.peer_addr
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
Err(err) => {
|
||||
// https://github.com/shadowsocks/shadowsocks-rust/issues/292
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user