Release 1.16.0

- [API Change] Add lsquic_conn_n_avail_streams()
- [BUGFIX] only dispatch crypto stream read events if WANT_READ is on
This commit is contained in:
Dmitri Tikhonov 2018-10-03 10:32:26 -04:00
parent 0a19f39d64
commit 66f9afccd0
3 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2018-10-03
- 1.16.0
- [API Change] Add lsquic_conn_n_avail_streams()
- [BUGFIX] only dispatch crypto stream read events if WANT_READ is on
2018-09-27
- 1.15.0
- [API Change] Add LSCONN_ST_PEER_GOING_AWAY to the list of conn statuses

View File

@ -24,7 +24,7 @@ extern "C" {
#endif
#define LSQUIC_MAJOR_VERSION 1
#define LSQUIC_MINOR_VERSION 15
#define LSQUIC_MINOR_VERSION 16
#define LSQUIC_PATCH_VERSION 0
/**
@ -668,6 +668,10 @@ lsquic_engine_send_unsent_packets (lsquic_engine_t *engine);
void
lsquic_engine_destroy (lsquic_engine_t *);
/** Return max allowed outbound streams less current outbound streams. */
unsigned
lsquic_conn_n_avail_streams (const lsquic_conn_t *);
void lsquic_conn_make_stream(lsquic_conn_t *);
/** Return number of delayed streams currently pending */

View File

@ -989,12 +989,22 @@ either_side_going_away (const struct full_conn *conn)
}
unsigned
lsquic_conn_n_avail_streams (const lsquic_conn_t *lconn)
{
struct full_conn *conn = (struct full_conn *) lconn;
unsigned stream_count = count_streams(conn, 0);
if (conn->fc_cfg.max_streams_out < stream_count)
return 0;
return conn->fc_cfg.max_streams_out - stream_count;
}
void
lsquic_conn_make_stream (lsquic_conn_t *lconn)
{
struct full_conn *conn = (struct full_conn *) lconn;
unsigned stream_count = count_streams(conn, 0);
if (stream_count < conn->fc_cfg.max_streams_out)
if (lsquic_conn_n_avail_streams(lconn) > 0)
{
if (!new_stream(conn, generate_stream_id(conn), SCF_CALL_ON_NEW))
ABORT_ERROR("could not create new stream: %s", strerror(errno));
@ -1220,6 +1230,7 @@ process_stream_frame (struct full_conn *conn, lsquic_packet_in_t *packet_in,
}
if (stream->id == LSQUIC_STREAM_HANDSHAKE
&& (stream->stream_flags & STREAM_WANT_READ)
&& !(conn->fc_flags & FC_SERVER)
&& !(conn->fc_conn.cn_flags & LSCONN_HANDSHAKE_DONE))
{ /* To enable decryption, process handshake stream as soon as its