Release 1.19.3

- [BUGFIX] Q044: don't encode packet number in 6 bytes.  Six-byte
  packet number encoding does not exist in Q044.  This fixes a
  regression introduced in '[BUGFIX] Buffered packets can contain
  ACK frames' -- we need to keep QUIC version in mind when selecting
  the longest possible packet number encoding used for the buffered
  packet that carries the ACK.
- [BUGFIX] Do not increase CWND when timeout occurs.
- http_client: support setting handshake timeout on command line.
  Use -o handshake_to=timeout.
- http_client: use -k to connect UDP socket to pick up ICMP errors.
- http_client: allow pathless mode, when only handshake is performed
  without issuing any requests.  This can be done by simply not
  specifying a -p flag on the command line.
This commit is contained in:
Dmitri Tikhonov 2019-02-18 08:40:51 -05:00
parent 3329170846
commit 9c4445241e
12 changed files with 113 additions and 20 deletions

View file

@ -183,10 +183,14 @@ lsquic_cubic_loss (struct lsquic_cubic *cubic)
void
lsquic_cubic_timeout (struct lsquic_cubic *cubic)
{
unsigned long cwnd;
cwnd = cubic->cu_cwnd;
LSQ_DEBUG("%s(cubic)", __func__);
cubic_reset(cubic);
cubic->cu_ssthresh = cubic->cu_cwnd;
cubic->cu_tcp_cwnd = cubic->cu_cwnd;
cubic->cu_ssthresh = cwnd / 2;
cubic->cu_tcp_cwnd = 2 * TCP_MSS;
cubic->cu_cwnd = 2 * TCP_MSS;
LSQ_INFO("timeout, cwnd: %lu", cubic->cu_cwnd);
LOG_CWND(cubic);
}

View file

@ -2106,6 +2106,7 @@ process_incoming_packet (struct full_conn *conn, lsquic_packet_in_t *packet_in)
}
LSQ_DEBUG("end of version negotiation: agreed upon %s",
lsquic_ver2str[conn->fc_ver_neg.vn_ver]);
lsquic_send_ctl_verneg_done(&conn->fc_send_ctl);
}
return process_regular_packet(conn, packet_in);
}

View file

@ -1923,7 +1923,7 @@ lsquic_enc_session_get_zero_rtt (lsquic_enc_session_t *enc_session,
sz += sizeof(struct lsquic_zero_rtt_storage);
if (len < sz)
{
LSQ_DEBUG("client provided buf is too small %lu < %lu", len, sz);
LSQ_DEBUG("client provided buf is too small %zu < %zu", len, sz);
errno = ENOBUFS;
return -1;
}

View file

@ -257,6 +257,7 @@ lsquic_send_ctl_init (lsquic_send_ctl_t *ctl, struct lsquic_alarmset *alset,
for (i = 0; i < sizeof(ctl->sc_buffered_packets) /
sizeof(ctl->sc_buffered_packets[0]); ++i)
TAILQ_INIT(&ctl->sc_buffered_packets[i].bpq_packets);
ctl->sc_max_packno_bits = PACKNO_LEN_4; /* Safe value before verneg */
}
@ -1698,7 +1699,7 @@ send_ctl_get_buffered_packet (lsquic_send_ctl_t *ctl,
{
LSQ_DEBUG("steal ACK frame from low-priority buffered queue");
ack_action = AA_STEAL;
bits = PACKNO_LEN_6;
bits = ctl->sc_max_packno_bits;
}
/* If ACK can be generated, write it to the first buffered packet. */
else if (lconn->cn_if->ci_can_write_ack(lconn))
@ -1709,7 +1710,7 @@ send_ctl_get_buffered_packet (lsquic_send_ctl_t *ctl,
/* Packet length is set to the largest possible size to guarantee
* that buffered packet with the ACK will not need to be split.
*/
bits = PACKNO_LEN_6;
bits = ctl->sc_max_packno_bits;
}
else
goto no_ack_action;
@ -1781,12 +1782,17 @@ enum lsquic_packno_bits
lsquic_send_ctl_calc_packno_bits (lsquic_send_ctl_t *ctl)
{
lsquic_packno_t smallest_unacked;
enum lsquic_packno_bits bits;
unsigned n_in_flight;
smallest_unacked = lsquic_send_ctl_smallest_unacked(ctl);
n_in_flight = lsquic_cubic_get_cwnd(&ctl->sc_cubic) / ctl->sc_pack_size;
return calc_packno_bits(ctl->sc_cur_packno + 1, smallest_unacked,
bits = calc_packno_bits(ctl->sc_cur_packno + 1, smallest_unacked,
n_in_flight);
if (bits <= ctl->sc_max_packno_bits)
return bits;
else
return ctl->sc_max_packno_bits;
}
@ -1929,3 +1935,18 @@ lsquic_send_ctl_mem_used (const struct lsquic_send_ctl *ctl)
return size;
}
void
lsquic_send_ctl_verneg_done (struct lsquic_send_ctl *ctl)
{
if ((1 << ctl->sc_conn_pub->lconn->cn_version) &
LSQUIC_GQUIC_HEADER_VERSIONS)
ctl->sc_max_packno_bits = PACKNO_LEN_6;
else
/* Assuming Q044 */
ctl->sc_max_packno_bits = PACKNO_LEN_4;
LSQ_DEBUG("version negotiation done (%s): max packno bits: %u",
lsquic_ver2str[ ctl->sc_conn_pub->lconn->cn_version ],
ctl->sc_max_packno_bits);
}

View file

@ -89,6 +89,7 @@ typedef struct lsquic_send_ctl {
} sc_cached_bpt;
unsigned sc_next_limit;
unsigned sc_n_scheduled;
enum lsquic_packno_bits sc_max_packno_bits;
#if LSQUIC_SEND_STATS
struct {
unsigned n_total_sent,
@ -283,4 +284,7 @@ int
lsquic_send_ctl_buffered_and_same_prio_as_headers (struct lsquic_send_ctl *,
const struct lsquic_stream *);
void
lsquic_send_ctl_verneg_done (struct lsquic_send_ctl *);
#endif