lsquic icon indicating copy to clipboard operation
lsquic copied to clipboard

"lsquic.h" not enough, lsquic_stream_maybe_reset no avail for use

Open marakew opened this issue 1 year ago • 8 comments

can you reorganize the structure of the API functions? for example, in your lsquic/bin/* examples you use many references to internal function declarations while they are not available from the public API

then what is the point of all these examples if they cannot be used via the API?

marakew avatar Mar 03 '25 10:03 marakew

Thank you for pointing this out. We will review.

dtikhonov avatar Oct 12 '25 11:10 dtikhonov

There are two instances in the example programs where this function is used. Both of these instances are for testing specific behaviors -- useful for development. This function is not meant for general use.

We could potentially place it in lsquic.h, but mark it as internal. I wonder whether there is a use case for this function in the general case. 🤔

dtikhonov avatar Oct 26 '25 02:10 dtikhonov

as example to allow send http3 error codes https://datatracker.ietf.org/doc/html/draft-ietf-quic-http-23#section-8.1

https://github.com/litespeedtech/lsquic/blob/7e0c302ed8271c0019ea1155ebc9357bf4973f42/src/liblsquic/lsquic_hq.h#L65

marakew avatar Oct 26 '25 11:10 marakew

These are all transport-level error codes -- the application should have no knowledge of them. Which error code do you think an application would ever be able to send?

dtikhonov avatar Oct 26 '25 12:10 dtikhonov

nghttp3 thinking this is app level error codes https://github.com/ngtcp2/nghttp3/blob/164fbfa0f4da67d4c112bc6e5260846b5254b3cb/lib/includes/nghttp3/nghttp3.h#L353

openssl can send any of error codes https://github.com/openssl/openssl/blob/311f7bd6dd609cd32faa406bbddca580ae4fd4eb/doc/designs/quic-design/quic-api.md?plain=1#L547

marakew avatar Oct 26 '25 12:10 marakew

also openssl api SSL_stream_reset with error codes

https://github.com/openssl/openssl/blob/311f7bd6dd609cd32faa406bbddca580ae4fd4eb/doc/designs/quic-design/quic-api.md?plain=1#L687

marakew avatar Oct 26 '25 12:10 marakew

lsquic predates all of these and has been incorporated into web servers without needing to expose these error codes.

dtikhonov avatar Oct 26 '25 13:10 dtikhonov

To summarize:

My view is that the internal functions should remain outside of the public API. The fact that they are used in example tools is fine: we have to test this thing somehow.

We can add comments to the example code to say something to the effect of "this is an internal function; we use it here to test X." At that point we can close this issue.

dtikhonov avatar Nov 01 '25 09:11 dtikhonov