Skip to content

Commit

Permalink
Release 2.4.6
Browse files Browse the repository at this point in the history
- Minor code cleanup and logging improvements.
- Server and client programs: include library version (e.g. 2.4.6)
  into `server' and `user-agent' headers.
  • Loading branch information
Dmitri Tikhonov committed Oct 11, 2019
1 parent 7542f0f commit ad08470
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2019-10-11
- 2.4.6
- Minor code cleanup and logging improvements.
- Server and client programs: include library version (e.g. 2.4.6)
into `server' and `user-agent' headers.

2019-10-08
- 2.4.5
- [OPTIMIZATION]: flush encoder stream only when necessary.
Expand Down
2 changes: 1 addition & 1 deletion include/lsquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern "C" {

#define LSQUIC_MAJOR_VERSION 2
#define LSQUIC_MINOR_VERSION 4
#define LSQUIC_PATCH_VERSION 5
#define LSQUIC_PATCH_VERSION 6

/**
* Engine flags:
Expand Down
1 change: 1 addition & 0 deletions src/liblsquic/lsquic_attq.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ attq_count_before (struct attq *q, lsquic_time_t cutoff)
return total_count;
}
assert(0);
return total_count;
}


Expand Down
30 changes: 28 additions & 2 deletions src/liblsquic/lsquic_full_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -4211,35 +4211,56 @@ full_conn_ci_is_tickable (lsquic_conn_t *lconn)
struct lsquic_stream *stream;

if (!TAILQ_EMPTY(&conn->fc_pub.service_streams))
{
LSQ_DEBUG("tickable: there are streams to be serviced");
return 1;
}

if ((conn->fc_enpub->enp_flags & ENPUB_CAN_SEND)
&& (should_generate_ack(conn) ||
!lsquic_send_ctl_sched_is_blocked(&conn->fc_send_ctl)))
{
if (conn->fc_flags & (FC_SEND_GOAWAY|FC_SEND_STOP_WAITING
|FC_SEND_PING|FC_SEND_WUF|FC_CLOSING))
const enum full_conn_flags send_flags = FC_SEND_GOAWAY
|FC_SEND_STOP_WAITING|FC_SEND_PING|FC_SEND_WUF|FC_CLOSING;
if (conn->fc_flags & send_flags)
{
LSQ_DEBUG("tickable: flags: 0x%X", conn->fc_flags & send_flags);
goto check_can_send;
}
if (lsquic_send_ctl_has_buffered(&conn->fc_send_ctl))
{
LSQ_DEBUG("tickable: has buffered packets");
goto check_can_send;
}
if (!TAILQ_EMPTY(&conn->fc_pub.sending_streams))
{
LSQ_DEBUG("tickable: there are sending streams");
goto check_can_send;
}
if ((conn->fc_conn.cn_flags & LSCONN_HANDSHAKE_DONE) ||
conn->fc_conn.cn_esf_c->esf_is_zero_rtt_enabled(
conn->fc_conn.cn_enc_session))
{
TAILQ_FOREACH(stream, &conn->fc_pub.write_streams,
next_write_stream)
if (lsquic_stream_write_avail(stream))
{
LSQ_DEBUG("tickable: stream %"PRIu64" can be written to",
stream->id);
goto check_can_send;
}
}
else
{
TAILQ_FOREACH(stream, &conn->fc_pub.write_streams,
next_write_stream)
if (LSQUIC_GQUIC_STREAM_HANDSHAKE == stream->id
&& lsquic_stream_write_avail(stream))
{
LSQ_DEBUG("tickable: stream %"PRIu64" can be written to",
stream->id);
goto check_can_send;
}
}
goto check_readable_streams;
check_can_send:
Expand All @@ -4250,8 +4271,13 @@ full_conn_ci_is_tickable (lsquic_conn_t *lconn)
check_readable_streams:
TAILQ_FOREACH(stream, &conn->fc_pub.read_streams, next_read_stream)
if (lsquic_stream_readable(stream))
{
LSQ_DEBUG("tickable: stream %"PRIu64" can be read from",
stream->id);
return 1;
}

LSQ_DEBUG("not tickable");
return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions src/liblsquic/lsquic_full_conn_ietf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1213,8 +1213,6 @@ lsquic_ietf_full_conn_server_new (struct lsquic_engine_public *enpub,
= imc->imc_largest_recvd[pns];
}

/* TODO: Transfer incoming packets. */

/* Mini connection sends out packets 0, 1, 2... and so on. It deletes
* packets that have been successfully sent and acked or those that have
* been lost. We take ownership of all packets in mc_packets_out; those
Expand Down
6 changes: 6 additions & 0 deletions src/liblsquic/lsquic_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ enum stream_history_event
SHE_CLOSE = 'X',
SHE_DELAY_SW = 'y',
SHE_FORCE_FINISH = 'Z',
SHE_WANTREAD_NO = '0', /* "YES" must be one more than "NO" */
SHE_WANTREAD_YES = '1',
SHE_WANTWRITE_NO = '2',
SHE_WANTWRITE_YES = '3',
};

static void
Expand Down Expand Up @@ -1741,6 +1745,7 @@ stream_wantwrite (struct lsquic_stream *stream, int new_val)
int
lsquic_stream_wantread (lsquic_stream_t *stream, int is_want)
{
SM_HISTORY_APPEND(stream, SHE_WANTREAD_NO + !!is_want);
if (!(stream->stream_flags & STREAM_U_READ_DONE))
{
if (is_want)
Expand All @@ -1762,6 +1767,7 @@ lsquic_stream_wantwrite (lsquic_stream_t *stream, int is_want)

is_want = !!is_want;

SM_HISTORY_APPEND(stream, SHE_WANTWRITE_NO + is_want);
if (0 == (stream->stream_flags & STREAM_U_WRITE_DONE)
&& SSHS_BEGIN == stream->sm_send_headers_state)
{
Expand Down
1 change: 0 additions & 1 deletion src/liblsquic/lsquic_varint.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ lsquic_varint_read (const unsigned char *p, const unsigned char *end,
*valp = val;
return 8;
}
assert(0);
}


Expand Down
1 change: 1 addition & 0 deletions test/http_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,6 +1533,7 @@ main (int argc, char **argv)
#if LSQUIC_CONN_STATS
prog.prog_api.ea_stats_fh = stats_fh;
#endif
prog.prog_settings.es_ua = LITESPEED_ID;

if (client_ctx.qif_file)
{
Expand Down
2 changes: 1 addition & 1 deletion test/http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ send_headers2 (struct lsquic_stream *stream, struct lsquic_stream_ctx *st_h,
},
{
.name = { .iov_base = "server", .iov_len = 6, },
.value = { .iov_base = "LiteSpeed", .iov_len = 9, },
.value = { .iov_base = LITESPEED_ID, .iov_len = sizeof(LITESPEED_ID) - 1, },
},
{
.name = { .iov_base = "content-type", .iov_len = 12, },
Expand Down
5 changes: 5 additions & 0 deletions test/test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,9 @@ create_lsquic_reader_ctx (const char *filename);
void
destroy_lsquic_reader_ctx (struct reader_ctx *ctx);

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define LITESPEED_ID "lsquic" "/" TOSTRING(LSQUIC_MAJOR_VERSION) "." \
TOSTRING(LSQUIC_MINOR_VERSION) "." TOSTRING(LSQUIC_PATCH_VERSION)

#endif
6 changes: 6 additions & 0 deletions test/unittests/test_attq.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ test_attq_ordering (enum sort_action sa)

q = attq_create();

for (i = 0; i < sizeof(curiosity); ++i)
{
unsigned count_before = attq_count_before(q, curiosity[i]);
assert(count_before == 0);
}

conns = calloc(sizeof(curiosity), sizeof(conns[0]));
for (i = 0; i < sizeof(curiosity); ++i)
{
Expand Down

0 comments on commit ad08470

Please sign in to comment.