alibaba / xquic

XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.
Apache License 2.0
1.65k stars 326 forks source link

[Feature]: Unify the connection related interfaces. #234

Open Luffbee opened 1 year ago

Luffbee commented 1 year ago

Before request a new feature

Describe the feature you'd like supported

The connection related interfaces are inconsistent: some use xqc_cid_t as user handler, some use xqc_connection_t*. As xqc_cid_t is a complex type and must find the hash map to get the real connection context, using it as user handler is weird. Is there any reason to design like this?

IMO, using xqc_connection_t* as the user handler is the most convenient and most efficient way.

Describe alternatives you've considered

use xqc_connection_t* to replace all xqc_cid_t, and provide another interface const xqc_cid_t* xqc_conn_cid(xqc_connection_t*conn) to get the cid.

Additional context

No response