Compile with the latest ngtcp2
This commit is contained in:
parent
19cf303828
commit
25f29e7634
|
@ -317,13 +317,6 @@ struct Stream {
|
||||||
Stream();
|
Stream();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Crypto {
|
|
||||||
Crypto() : datalen(0), acked_offset(0) {}
|
|
||||||
std::array<uint8_t, 1024> data;
|
|
||||||
size_t datalen;
|
|
||||||
size_t acked_offset;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Client {
|
struct Client {
|
||||||
DefaultMemchunks wb;
|
DefaultMemchunks wb;
|
||||||
std::unordered_map<int32_t, Stream> streams;
|
std::unordered_map<int32_t, Stream> streams;
|
||||||
|
@ -338,8 +331,6 @@ struct Client {
|
||||||
ev_timer pkt_timer;
|
ev_timer pkt_timer;
|
||||||
ngtcp2_conn *conn;
|
ngtcp2_conn *conn;
|
||||||
quic::Error last_error;
|
quic::Error last_error;
|
||||||
// Client never send CRYPTO in Short packet.
|
|
||||||
std::array<Crypto, 2> crypto;
|
|
||||||
size_t max_pktlen;
|
size_t max_pktlen;
|
||||||
bool close_requested;
|
bool close_requested;
|
||||||
FILE *qlog_file;
|
FILE *qlog_file;
|
||||||
|
|
|
@ -325,7 +325,6 @@ int Client::quic_init(const sockaddr *local_addr, socklen_t local_addrlen,
|
||||||
ngtcp2_crypto_decrypt_cb,
|
ngtcp2_crypto_decrypt_cb,
|
||||||
ngtcp2_crypto_hp_mask_cb,
|
ngtcp2_crypto_hp_mask_cb,
|
||||||
h2load::recv_stream_data,
|
h2load::recv_stream_data,
|
||||||
nullptr, // acked_crypto_offset
|
|
||||||
h2load::acked_stream_data_offset,
|
h2load::acked_stream_data_offset,
|
||||||
nullptr, // stream_open
|
nullptr, // stream_open
|
||||||
h2load::stream_close,
|
h2load::stream_close,
|
||||||
|
@ -499,14 +498,8 @@ void Client::quic_set_tls_alert(uint8_t alert) {
|
||||||
void Client::quic_write_client_handshake(ngtcp2_crypto_level level,
|
void Client::quic_write_client_handshake(ngtcp2_crypto_level level,
|
||||||
const uint8_t *data, size_t datalen) {
|
const uint8_t *data, size_t datalen) {
|
||||||
assert(level < 2);
|
assert(level < 2);
|
||||||
auto &crypto = quic.crypto[level];
|
|
||||||
assert(crypto.data.size() >= crypto.datalen + datalen);
|
|
||||||
|
|
||||||
auto p = std::begin(crypto.data) + crypto.datalen;
|
ngtcp2_conn_submit_crypto_data(quic.conn, level, data, datalen);
|
||||||
std::copy_n(data, datalen, p);
|
|
||||||
crypto.datalen += datalen;
|
|
||||||
|
|
||||||
ngtcp2_conn_submit_crypto_data(quic.conn, level, p, datalen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void quic_pkt_timeout_cb(struct ev_loop *loop, ev_timer *w, int revents) {
|
void quic_pkt_timeout_cb(struct ev_loop *loop, ev_timer *w, int revents) {
|
||||||
|
|
Loading…
Reference in New Issue