Skip to content

Residual stream #1968

@Zoruk

Description

@Zoruk

In some case while just using the provided Connection method it is possible to have residual stream that are never collected/cleaned within a quiche Connection.

Here is how to trigger it with a code sample

        let mut pipe = testing::Pipe::with_server_config(&mut config).unwrap();

        pipe.handshake().unwrap();

        let mut buf = [0u8;32];

        // Open a stream and send some data
        assert_eq!(pipe.client.stream_send(2, b"hello world", false), Ok(11));
        pipe.advance().unwrap();

        // Send a reset_stream frame
        pipe.client.stream_shutdown(2, Shutdown::Write, 0).unwrap();
        pipe.advance().unwrap();

        // check that the stream are correctly handled
        assert_eq!(pipe.client.streams.len(), 0);
        assert_eq!(pipe.server.streams.len(), 1);

        // Shutdown on the server side
        pipe.server.stream_shutdown(2, Shutdown::Read, 0).unwrap();

        // Now to be coherent we should have no more stream in the server side but this assertion is true
        eprintln!("this assertion should failed");
        assert_eq!(pipe.server.streams.len(), 1); // we expect the length to be 0 here

        // But in fact the stream is not collected and quiche behave as follows
        assert_eq!(pipe.server.stream_readable_next(), None);
        assert_eq!(pipe.server.stream_recv(2, &mut buf), Err(Error::Done));
        assert_eq!(pipe.server.streams.len(), 1);

        // It is now impossible to collect/cleanup the stream

I can make a pull request to fix this if you are interested
Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions