Skip to content

Commit 7d5de66

Browse files
committed
code polish
1 parent d53ed92 commit 7d5de66

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

core/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
clippy::indexing_slicing,
5151
clippy::separated_literal_suffix, // conflicts with clippy::unseparated_literal_suffix
5252
clippy::single_char_lifetime_names, // TODO: change lifetime names
53+
unknown_lints, // for windows nightly
54+
linker_messages, // for windows nightly
55+
unused_attributes, // for windows nightly
5356
)]
5457
#![doc = include_str!("../docs/en/overview.md")]
5558

core/src/net/operator/windows/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
88
use std::time::{Duration, Instant};
99
use windows_sys::core::{PCSTR, PSTR};
1010
use windows_sys::Win32::Foundation::{
11-
ERROR_INVALID_PARAMETER, FALSE, HANDLE, INVALID_HANDLE_VALUE,
11+
GetLastError, ERROR_INVALID_PARAMETER, FALSE, HANDLE, INVALID_HANDLE_VALUE,
1212
};
1313
use windows_sys::Win32::Networking::WinSock::{
1414
getsockopt, setsockopt, AcceptEx, WSAGetLastError, WSARecv, WSASend, WSASocketW,
@@ -179,10 +179,13 @@ impl<'o> Operator<'o> {
179179
| SyscallName::send
180180
| SyscallName::WSASend => {
181181
let r = entry.dwNumberOfBytesTransferred.into();
182-
if r > 0 {
182+
if 0 == r {
183+
// in progress
184+
continue;
185+
} else if r > 0 {
183186
r
184187
} else {
185-
-c_longlong::from(WSAEINPROGRESS)
188+
-c_longlong::from(GetLastError())
186189
}
187190
}
188191
_ => panic!("unsupported"),

hook/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
clippy::separated_literal_suffix, // conflicts with clippy::unseparated_literal_suffix
4646
clippy::single_char_lifetime_names, // TODO: change lifetime names
4747
clippy::test_attr_in_doctest,
48-
unknown_lints,
49-
linker_messages,
48+
unknown_lints, // for windows nightly
49+
linker_messages, // for windows nightly
5050
)]
5151
#![doc = include_str!("../docs/en/hook.md")]
5252

0 commit comments

Comments
 (0)