Skip to content

Commit

Permalink
Updates concerning ngtcp2 expiry from curl. (#271)
Browse files Browse the repository at this point in the history
Pull in ngtcp2 curl expiry logic from curl master and the currently
unmerged curl/curl#11390.
  • Loading branch information
bneradt committed Jul 5, 2023
1 parent 5d879b2 commit a128dff
Show file tree
Hide file tree
Showing 2 changed files with 298 additions and 110 deletions.
21 changes: 20 additions & 1 deletion local/include/core/http3.h
Expand Up @@ -61,6 +61,25 @@ BufferWriter &bwformat(BufferWriter &w, bwf::Spec const &spec, bwf::Nghttp3Error
} // namespace SWOC_VERSION_NS
} // namespace swoc

/** Contains information for a particular cycle of reading QUIC packets.
*
* ngtcp2 requires some state to be maintained within a cycle of reading a set
* of packets. By "cycle" I mean a single set of processing ingress and egress
* packets. This information is shared across the relevant function calls via
* an instance of PacketIoContext. In curl, this is the c-struct pkt_io_ctx.
*/
struct PacketIoContext
{
public:
/** Initialize PacketIoContext. */
PacketIoContext();

public:
ngtcp2_tstamp ts = 0;
size_t pkt_count = 0;
ngtcp2_path_storage ps;
};

/** Encapsulate the buffer for the QUIC hanshake. */
class QuicHandshake
{
Expand Down Expand Up @@ -332,7 +351,7 @@ class H3Session : public Session

/** Perform the HTTP/3 (ngtcp2 and nghttp3) configuration and QUIC handshake
* for a client connection. */
swoc::Errata client_session_init();
swoc::Errata client_session_init(PacketIoContext *packet_context);

/** Perform the HTTP/3 (ngtcp2 and nghttp3) configuration for a server
* connection. */
Expand Down

0 comments on commit a128dff

Please sign in to comment.