mirror of
https://gitea.invidious.io/iv-org/litespeed-quic.git
synced 2024-08-15 00:53:43 +00:00
Latest changes:
- Fix busy loop: tickable must make progress. When connection is self-reporting as tickable, it must make progress when ticked. There are two issues: 1. If there are buffered packets, the connection is only tickable if they can be sent out. 2. A connection is tickable if there are streams on the servicing queue. When the tick occurs, we must service the stream independent of whether any packets are sent. - Fix assertion in pacer which can be incorrect under some conditions. - cmake: do not turn on address sanitizer if in Travis.
This commit is contained in:
parent
9918a066f1
commit
bdba46fd00
4 changed files with 34 additions and 27 deletions
14
CHANGELOG
14
CHANGELOG
|
@ -1,3 +1,17 @@
|
|||
2018-04-23
|
||||
|
||||
- Fix busy loop: tickable must make progress. When connection is
|
||||
self-reporting as tickable, it must make progress when ticked. There
|
||||
are two issues:
|
||||
1. If there are buffered packets, the connection is only tickable if
|
||||
they can be sent out.
|
||||
2. A connection is tickable if there are streams on the servicing
|
||||
queue. When the tick occurs, we must service the stream
|
||||
independent of whether any packets are sent.
|
||||
- Fix assertion in pacer which can be incorrect under some
|
||||
conditions.
|
||||
- cmake: do not turn on address sanitizer if in Travis.
|
||||
|
||||
2018-04-20
|
||||
|
||||
- [BUGFIX] Fix bug in lsquic_engine_connect() exposed by yesterday's
|
||||
|
|
|
@ -15,12 +15,15 @@ Fetch Google's home page:
|
|||
|
||||
./http_client -H www.google.co.uk -s 2a00:1450:4009:80c::2003:443 -p /
|
||||
|
||||
NOTE: If you do not get a response from the google server the ip-adress might be wrong. Google.com has different ip-adresses in different regions and if you are using an ip adress from a wrong region the server won't respond.
|
||||
You can find out the correct ip-adress by visiting google.com in your browser using an add-on that shows you the ip-adress for example.
|
||||
|
||||
In the example above, -H specifies the domain; it is also used as the value
|
||||
of SNI paramater in the handshake.
|
||||
|
||||
The IP address and the port number are specified using the -s flag.
|
||||
|
||||
(Since www.google.com has different IP addresses in different regions, check
|
||||
that you are using the correct IP address by resolving www.google.com first
|
||||
by using nslookup, dig, ping, or some other tool.)
|
||||
|
||||
POST a file to calculate its CRC32 checksum:
|
||||
|
||||
./http_client -H www.litespeedtech.com -s 127.0.0.1:443 \
|
||||
|
|
|
@ -2626,7 +2626,7 @@ full_conn_ci_tick (lsquic_conn_t *lconn, lsquic_time_t now)
|
|||
if (conn->fc_flags & FC_IMMEDIATE_CLOSE_FLAGS) \
|
||||
{ \
|
||||
tick |= immediate_close(conn); \
|
||||
goto end; \
|
||||
goto close_end; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
@ -2836,9 +2836,6 @@ full_conn_ci_tick (lsquic_conn_t *lconn, lsquic_time_t now)
|
|||
end_write:
|
||||
|
||||
skip_write:
|
||||
service_streams(conn);
|
||||
CLOSE_IF_NECESSARY();
|
||||
|
||||
RETURN_IF_OUT_OF_PACKETS();
|
||||
|
||||
if ((conn->fc_flags & FC_CLOSING) && conn_ok_to_close(conn))
|
||||
|
@ -2899,6 +2896,10 @@ full_conn_ci_tick (lsquic_conn_t *lconn, lsquic_time_t now)
|
|||
tick |= TICK_SEND;
|
||||
|
||||
end:
|
||||
service_streams(conn);
|
||||
CLOSE_IF_NECESSARY();
|
||||
|
||||
close_end:
|
||||
lsquic_send_ctl_set_buffer_stream_packets(&conn->fc_send_ctl, 1);
|
||||
return tick;
|
||||
}
|
||||
|
@ -3312,35 +3313,24 @@ full_conn_ci_is_tickable (lsquic_conn_t *lconn)
|
|||
{
|
||||
struct full_conn *conn = (struct full_conn *) lconn;
|
||||
const struct lsquic_stream *stream;
|
||||
int can_send;
|
||||
|
||||
/* This caches the value so that we only need to call the function once */
|
||||
#define CAN_SEND() \
|
||||
(can_send >= 0 ? can_send : \
|
||||
(can_send = lsquic_send_ctl_can_send(&conn->fc_send_ctl)))
|
||||
|
||||
if (lsquic_send_ctl_has_buffered(&conn->fc_send_ctl))
|
||||
return 1;
|
||||
|
||||
if (!TAILQ_EMPTY(&conn->fc_pub.service_streams))
|
||||
return 1;
|
||||
|
||||
can_send = -1;
|
||||
if (!TAILQ_EMPTY(&conn->fc_pub.sending_streams) && CAN_SEND())
|
||||
return 1;
|
||||
|
||||
TAILQ_FOREACH(stream, &conn->fc_pub.read_streams, next_read_stream)
|
||||
if (lsquic_stream_readable(stream))
|
||||
return 1;
|
||||
|
||||
if (!TAILQ_EMPTY(&conn->fc_pub.write_streams) && CAN_SEND())
|
||||
if (lsquic_send_ctl_can_send(&conn->fc_send_ctl))
|
||||
{
|
||||
if (lsquic_send_ctl_has_buffered(&conn->fc_send_ctl))
|
||||
return 1;
|
||||
if (!TAILQ_EMPTY(&conn->fc_pub.sending_streams))
|
||||
return 1;
|
||||
TAILQ_FOREACH(stream, &conn->fc_pub.write_streams, next_write_stream)
|
||||
if (lsquic_stream_write_avail(stream))
|
||||
return 1;
|
||||
}
|
||||
|
||||
#undef CAN_SEND
|
||||
TAILQ_FOREACH(stream, &conn->fc_pub.read_streams, next_read_stream)
|
||||
if (lsquic_stream_readable(stream))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ pacer_tick (struct pacer *pacer, lsquic_time_t now)
|
|||
{
|
||||
unsigned intertick;
|
||||
|
||||
assert(now > pacer->pa_now);
|
||||
assert(now >= pacer->pa_now);
|
||||
if (pacer->pa_now)
|
||||
{
|
||||
assert(now - pacer->pa_now < (1ULL << sizeof(unsigned) * 8));
|
||||
|
|
Loading…
Reference in a new issue