Skip to content

Commit 4d35b50

Browse files
committed
Another attempted fix
1 parent 702380e commit 4d35b50

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/multi.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,13 @@ fn upload_lots() {
160160
Ok(Message::Wait(socket, events, token)) => {
161161
let evented = mio::unix::EventedFd(&socket);
162162
if events.remove() {
163+
println!("REMOVE: {socket} / {token} / {events:?}");
163164
token_map.remove(&token).unwrap();
164-
if token_map.contains_key(&token) {
165-
t!(poll.deregister(&evented));
166-
}
165+
// Looks like older curl might close the fd before
166+
// sending this event, while newer curl sends this
167+
// event before closing the fd. Ignore the error for
168+
// now.
169+
let _ = poll.deregister(&evented);
167170
} else {
168171
let mut e = mio::Ready::empty();
169172
if events.input() {
@@ -174,6 +177,7 @@ fn upload_lots() {
174177
}
175178
if token == 0 {
176179
let token = next_token;
180+
println!("ADD: {socket} / {token} / {e:?}");
177181
next_token += 1;
178182
t!(m.assign(socket, token));
179183
token_map.insert(token, socket);
@@ -184,6 +188,7 @@ fn upload_lots() {
184188
mio::PollOpt::level()
185189
));
186190
} else {
191+
println!("ADJUST: {socket} / {token} / {e:?}");
187192
t!(poll.reregister(
188193
&evented,
189194
mio::Token(token),

0 commit comments

Comments
 (0)