add packet resending on unacknowledged packet
Some checks failed
Build and Test / friends (push) Failing after 9m6s
Build and Test / puyopuyo (push) Successful in 10m21s
Build and Test / mario-tennis (push) Successful in 10m32s
Build and Test / splatoon (push) Successful in 10m42s
Build and Test / fast-racing-neo (push) Successful in 10m49s
Build and Test / minecraft-wiiu (push) Successful in 10m50s
Build and Test / wii-u-chat (push) Successful in 10m54s
Build and Test / wii-sports-club (push) Successful in 10m55s
Build and Test / sonic-transformed (push) Successful in 10m57s
Build and Test / splatoon-testfire (push) Successful in 11m11s
Build and Test / super-mario-maker (push) Successful in 11m43s
Some checks failed
Build and Test / friends (push) Failing after 9m6s
Build and Test / puyopuyo (push) Successful in 10m21s
Build and Test / mario-tennis (push) Successful in 10m32s
Build and Test / splatoon (push) Successful in 10m42s
Build and Test / fast-racing-neo (push) Successful in 10m49s
Build and Test / minecraft-wiiu (push) Successful in 10m50s
Build and Test / wii-u-chat (push) Successful in 10m54s
Build and Test / wii-sports-club (push) Successful in 10m55s
Build and Test / sonic-transformed (push) Successful in 10m57s
Build and Test / splatoon-testfire (push) Successful in 11m11s
Build and Test / super-mario-maker (push) Successful in 11m43s
This commit is contained in:
parent
40cdec017c
commit
e6520d99ec
1 changed files with 21 additions and 5 deletions
|
|
@ -97,7 +97,7 @@ impl<C: Crypto> Server<C> {
|
|||
.expect("packet malformed in creation"),
|
||||
);*/
|
||||
let mut inner = conn.inner.lock().await;
|
||||
let pieces = data.chunks(700);
|
||||
let pieces = data.chunks(962);
|
||||
let max_piece = pieces.len() - 1;
|
||||
let mut frag_num = 1;
|
||||
for (i, piece) in pieces.enumerate() {
|
||||
|
|
@ -141,9 +141,18 @@ impl<C: Crypto> Server<C> {
|
|||
.send_to(&data, conn.addr.regular_socket_addr)
|
||||
.await
|
||||
.ok();
|
||||
|
||||
break;
|
||||
sleep(Duration::from_millis(500)).await;
|
||||
}
|
||||
println!("connection exceeded max fail count, disconnecting");
|
||||
let Some(conn) = conn.upgrade() else {
|
||||
return;
|
||||
};
|
||||
let Some(this) = this.upgrade() else {
|
||||
return;
|
||||
};
|
||||
let mut conns = this.connections.write().await;
|
||||
conns.remove(&(conn.addr, conn.session_id));
|
||||
drop(conns);
|
||||
});
|
||||
frag_num += 1;
|
||||
}
|
||||
|
|
@ -336,6 +345,13 @@ impl<C: Crypto> Server<C> {
|
|||
warn!("data packet on inactive connection from: {:?}", addr);
|
||||
return;
|
||||
};
|
||||
|
||||
if header.type_flags.get_flags() & ACK != 0 {
|
||||
let mut inner = res.inner.lock().await;
|
||||
inner.unacknowledged_packets.remove(&header.sequence_id);
|
||||
return;
|
||||
}
|
||||
|
||||
info!("frag: {}", frag_id);
|
||||
let mut conn = res.inner.lock().await;
|
||||
let ack = new_data_packet(
|
||||
|
|
@ -481,8 +497,8 @@ impl<C: Crypto> Server<C> {
|
|||
inner.last_action = Instant::now();
|
||||
drop(inner);
|
||||
};
|
||||
if header.type_flags.get_flags() & ACK != 0 {
|
||||
info!("got ack(acks are ignored for now)");
|
||||
if header.type_flags.get_flags() & ACK != 0 && header.type_flags.get_types() != DATA {
|
||||
info!("got ack(acks are ignored for now(unless they are data acks))");
|
||||
return;
|
||||
}
|
||||
println!("{:?}", header);
|
||||
|
|
|
|||
Loading…
Reference in a new issue