mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-12 20:57:26 +08:00
avoid panic on smoltcp socket accept (#1272)
This commit is contained in:
11
.github/workflows/core.yml
vendored
11
.github/workflows/core.yml
vendored
@@ -154,14 +154,13 @@ jobs:
|
|||||||
name: easytier-web-dashboard
|
name: easytier-web-dashboard
|
||||||
path: easytier-web/frontend/dist/
|
path: easytier-web/frontend/dist/
|
||||||
|
|
||||||
- name: Cargo cache
|
- uses: Swatinem/rust-cache@v2
|
||||||
if: ${{ ! endsWith(matrix.TARGET, 'freebsd') }}
|
if: ${{ ! endsWith(matrix.TARGET, 'freebsd') }}
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: |
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
~/.cargo
|
# default: "v0-rust"
|
||||||
./target
|
prefix-key: ""
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Setup protoc
|
- name: Setup protoc
|
||||||
uses: arduino/setup-protoc@v3
|
uses: arduino/setup-protoc@v3
|
||||||
|
|||||||
10
.github/workflows/gui.yml
vendored
10
.github/workflows/gui.yml
vendored
@@ -151,13 +151,11 @@ jobs:
|
|||||||
pnpm -r install
|
pnpm -r install
|
||||||
pnpm -r build
|
pnpm -r build
|
||||||
|
|
||||||
- name: Cargo cache
|
- uses: Swatinem/rust-cache@v2
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: |
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
~/.cargo
|
# default: "v0-rust"
|
||||||
./target
|
prefix-key: ""
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Install rust target
|
- name: Install rust target
|
||||||
run: bash ./.github/workflows/install_rust.sh
|
run: bash ./.github/workflows/install_rust.sh
|
||||||
|
|||||||
10
.github/workflows/mobile.yml
vendored
10
.github/workflows/mobile.yml
vendored
@@ -98,13 +98,11 @@ jobs:
|
|||||||
pnpm -r install
|
pnpm -r install
|
||||||
pnpm -r build
|
pnpm -r build
|
||||||
|
|
||||||
- name: Cargo cache
|
- uses: Swatinem/rust-cache@v2
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: |
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
~/.cargo
|
# default: "v0-rust"
|
||||||
./target
|
prefix-key: ""
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Install rust target
|
- name: Install rust target
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -156,11 +156,14 @@ impl TcpStream {
|
|||||||
}
|
}
|
||||||
let (peer_addr, local_addr) = {
|
let (peer_addr, local_addr) = {
|
||||||
let socket = reactor.get_socket::<tcp::Socket>(*listener.handle);
|
let socket = reactor.get_socket::<tcp::Socket>(*listener.handle);
|
||||||
(
|
match (socket.remote_endpoint(), socket.local_endpoint()) {
|
||||||
// should be Some, because the state is Established
|
(Some(remote_endpoint), Some(local_endpoint)) => (
|
||||||
ep2sa(&socket.remote_endpoint().unwrap()),
|
// should be Some, because the state is Established
|
||||||
ep2sa(&socket.local_endpoint().unwrap()),
|
ep2sa(&remote_endpoint),
|
||||||
)
|
ep2sa(&local_endpoint),
|
||||||
|
),
|
||||||
|
_ => return Err(io::ErrorKind::NotConnected.into()),
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
|
|||||||
Reference in New Issue
Block a user