Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Feb 3, 2025
1 parent 58000bd commit b9d1f62
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
7 changes: 3 additions & 4 deletions neqo-transport/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1829,10 +1829,9 @@ impl Connection {
if self.role == Role::Server {
let Some(original_destination_cid) = self.original_destination_cid.as_ref() else {
qdebug!("[{self}] No original destination DCID");
return false;
}
self.cid_manager
.add_odcid(self.original_destination_cid.as_ref().unwrap().clone());
return;
};
self.cid_manager.add_odcid(original_destination_cid.clone());
// Make a path on which to run the handshake.
self.setup_handshake_path(path, now);
} else {
Expand Down
14 changes: 0 additions & 14 deletions neqo-transport/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1597,20 +1597,6 @@ impl CryptoStreams {
mark_as_sent(cs, space, tokens, offset1, len1, stats);
mark_as_sent(cs, space, tokens, offset2, len2, stats);
}
}
} else {
// Not at the start of the crypto stream, write the entire data.
[write_chunk(offset, data, builder), None]
};
for (offset, length) in written.into_iter().flatten() {
cs.tx.mark_as_sent(offset, length);
qdebug!("CRYPTO for {} offset={}, len={}", space, offset, length);
tokens.push(RecoveryToken::Crypto(CryptoRecoveryToken {
space,
offset,
length,
}));
stats.crypto += 1;
}
}
}
Expand Down
17 changes: 8 additions & 9 deletions neqo-transport/src/send_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,19 +502,18 @@ impl TxBuffer {
can_buffer
}

#[allow(clippy::missing_panics_doc)] // These are not possible.
fn first_unmarked_range(&mut self) -> Option<(u64, Option<u64>)> {
let (start, maybe_len) = self.ranges.first_unmarked_range();
let buffered = u64::try_from(self.buffered()).ok()?;
(start != self.retired() + buffered).then_some((start, maybe_len))
}

pub fn is_empty(&mut self) -> bool {
let (start, _) = self.ranges.first_unmarked_range();
start == self.retired() + u64::try_from(self.buffered()).unwrap()
self.first_unmarked_range().is_none()
}

#[allow(clippy::missing_panics_doc)] // These are not possible.
pub fn next_bytes(&mut self) -> Option<(u64, &[u8])> {
let (start, maybe_len) = self.ranges.first_unmarked_range();

if start == self.retired() + u64::try_from(self.buffered()).ok()? {
return None;
}
let (start, maybe_len) = self.first_unmarked_range()?;

// Convert from ranges-relative-to-zero to
// ranges-relative-to-buffer-start
Expand Down

0 comments on commit b9d1f62

Please sign in to comment.