Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/neqo-transport/tests/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  sni.rs

  Sprache: Rust
 

// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use neqo_transport::ConnectionParameters;
use test_fixture::{
    CountingConnectionIdGenerator, default_client, default_server, new_client, now,
};

#[test]
fn sni_no_slicing_at_nonzero_offset() {
    let mut client = default_client();
    let mut server = default_server();
    let mut now = now();

    // This packet will have two CRPYTO frames [y..end] and [0..x], where x < y.
    let ch1 = client.process_output(now).dgram();
    assert_eq!(client.stats().frame_tx.crypto, 2);
    // This packet will have one CRYPTO frame [x..y].
    let _ch2 = client.process_output(now).dgram();
    assert_eq!(client.stats().frame_tx.crypto, 3);
    // We are dropping the second packet and only deliver the first.
    let ack = server.process(ch1, now).dgram();
    // Client will now RTX the second packet.
    now += client.process(ack, now).callback();
    // Make sure it only has one CRYPTO frame.
    _ = client.process_output(now).dgram();
    assert_eq!(client.stats().frame_tx.crypto, 4);
}

#[test]
fn sni_no_slicing_at_nonzero_offset_no_mlkem() {
    let mut client =
        new_client::<CountingConnectionIdGenerator>(ConnectionParameters::default().mlkem(false));
    let mut now = now();

    // This packet will have two CRPYTO frames [x..end] and [0..x].
    _ = client.process_output(now).dgram();
    assert_eq!(client.stats().frame_tx.crypto, 2);
    // Client will now RTX the packet.
    now += client.process_output(now).callback();
    // Make sure it has two CRYPTO frames.
    _ = client.process_output(now).dgram();
    assert_eq!(client.stats().frame_tx.crypto, 4);
}

Messung V0.5 in Prozent
C=73 H=100 G=87

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.