Skip to content

Commit b6f8f04

Browse files
committed
fix bugs found in CI tests
1 parent 35b75e0 commit b6f8f04

5 files changed

Lines changed: 18 additions & 11 deletions

File tree

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
submodules: true
7777
- name: Install dependencies
7878
run: |
79-
apk add --no-cache musl-dev linux-headers libc++-dev libunwind-static
79+
apk add --no-cache musl-dev linux-headers libc++-dev llvm-libunwind-static
8080
apk add --no-cache clang lld capnproto-dev clang-libclang cmake make
8181
- name: Install Go for AWS-LC-FIPS
8282
if: contains(matrix.feature, 'vendored-aws-lc-fips')
@@ -111,7 +111,7 @@ jobs:
111111
submodules: true
112112
- name: Install dependencies
113113
run: |
114-
apk add --no-cache musl-dev linux-headers libc++-dev libc++-static libunwind-static
114+
apk add --no-cache musl-dev linux-headers libc++-dev libc++-static llvm-libunwind-static
115115
apk add --no-cache clang lld capnproto-dev clang-libclang cmake make
116116
- name: Cargo build
117117
run: cargo $UNSTABLE_OPTIONS build --profile release --no-default-features --features secure-vendored-mimalloc,${{ matrix.feature }},quic,vendored-c-ares

lib/vey-io-ext/src/udp/stream_copy/client/recv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub trait UdpCopyClientRecv {
5353
packets: &mut [UdpCopyPacket],
5454
) -> Poll<Result<usize, UdpCopyClientError>> {
5555
let mut count = 0;
56-
for (n, packet) in packets.iter_mut().enumerate() {
56+
for packet in packets.iter_mut() {
5757
match self.poll_recv_buf(cx, packet.buf_mut()) {
5858
Poll::Ready(Ok((off, len))) => {
5959
packet.set_length(off);
@@ -65,10 +65,10 @@ pub trait UdpCopyClientRecv {
6565
}
6666
Poll::Ready(Err(e)) => return Poll::Ready(Err(e)),
6767
Poll::Pending => {
68-
return if n == 0 {
68+
return if count == 0 {
6969
Poll::Pending
7070
} else {
71-
Poll::Ready(Ok(n - 1))
71+
Poll::Ready(Ok(count))
7272
};
7373
}
7474
}

lib/vey-io-ext/src/udp/stream_copy/remote/recv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub trait UdpCopyRemoteRecv {
5757
packets: &mut [UdpCopyPacket],
5858
) -> Poll<Result<usize, UdpCopyRemoteError>> {
5959
let mut count = 0;
60-
for (n, packet) in packets.iter_mut().enumerate() {
60+
for packet in packets.iter_mut() {
6161
match self.poll_recv_buf(cx, packet.buf_mut()) {
6262
Poll::Ready(Ok((off, len))) => {
6363
packet.set_offset(off);
@@ -69,10 +69,10 @@ pub trait UdpCopyRemoteRecv {
6969
}
7070
Poll::Ready(Err(e)) => return Poll::Ready(Err(e)),
7171
Poll::Pending => {
72-
return if n == 0 {
72+
return if count == 0 {
7373
Poll::Pending
7474
} else {
75-
Poll::Ready(Ok(n - 1))
75+
Poll::Ready(Ok(count))
7676
};
7777
}
7878
}

scripts/coverage/vey-proxy/0011_escaper_proxy_float/testcases.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ for port in 1080 1081
1212
do
1313
SOCKS5_PROXY="socks5h://127.0.0.1:${port}"
1414
test_socks5_proxy_http
15-
test_socks5_proxy_dns
1615

1716

1817
SOCKS4_PROXY="socks4a://127.0.0.1:${port}"
1918
test_socks4_proxy_http
2019
done
2120

2221

22+
SOCKS5_PROXY="socks5h://127.0.0.1:1080"
23+
test_socks5_proxy_dns
24+
25+
2326
vey_proxy_ctl escaper float_passive publish '{"type":"https","addr":"127.0.0.1:7443", "tls_name": "vey-proxy.local"}'
2427

2528

@@ -31,13 +34,17 @@ for port in 1080 1081
3134
do
3235
SOCKS5_PROXY="socks5h://127.0.0.1:${port}"
3336
test_socks5_proxy_http
34-
test_socks5_proxy_dns
3537

3638

3739
SOCKS4_PROXY="socks4a://127.0.0.1:${port}"
3840
test_socks4_proxy_http
3941
done
4042

43+
44+
SOCKS5_PROXY="socks5h://127.0.0.1:1080"
45+
test_socks5_proxy_dns
46+
47+
4148
vey_proxy_ctl escaper float_passive publish '{"type":"socks5","addr":"127.0.0.1:6080"}'
4249

4350

vey-proxy/src/module/masque_udp/send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl MasqueUdpSendBuffer {
5454
return;
5555
}
5656
for packet in packets {
57-
self.push_packet(packet.buf());
57+
self.push_packet(packet.payload());
5858
}
5959
}
6060

0 commit comments

Comments
 (0)