Skip to content

Commit a37b0c9

Browse files
author
Dmitri Tikhonov
committed
Release 1.17.8
[BUGFIX] Fix compilation on FreeBSD and 32-bit Linux
1 parent 18237fa commit a37b0c9

File tree

8 files changed

+8
-42
lines changed

8 files changed

+8
-42
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2018-12-10
2+
- 1.17.8
3+
- [BUGFIX] Fix compilation on FreeBSD and 32-bit Linux
4+
15
2018-12-03
26
- 1.17.7
37
- [BUGFIX] Do not unset PING alarm before ringing expired alarms.

include/lsquic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern "C" {
2525

2626
#define LSQUIC_MAJOR_VERSION 1
2727
#define LSQUIC_MINOR_VERSION 17
28-
#define LSQUIC_PATCH_VERSION 7
28+
#define LSQUIC_PATCH_VERSION 8
2929

3030
/**
3131
* Engine flags:

src/liblsquic/lsquic_engine.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ lsquic_engine_new (unsigned flags,
284284
const struct lsquic_engine_api *api)
285285
{
286286
lsquic_engine_t *engine;
287-
int tag_buf_len;
288287
char err_buf[100];
289288

290289
if (!api->ea_packets_out)
@@ -313,16 +312,6 @@ lsquic_engine_new (unsigned flags,
313312
engine->pub.enp_settings = *api->ea_settings;
314313
else
315314
lsquic_engine_init_settings(&engine->pub.enp_settings, flags);
316-
tag_buf_len = lsquic_gen_ver_tags(engine->pub.enp_ver_tags_buf,
317-
sizeof(engine->pub.enp_ver_tags_buf),
318-
engine->pub.enp_settings.es_versions);
319-
if (tag_buf_len <= 0)
320-
{
321-
LSQ_ERROR("cannot generate version tags buffer");
322-
free(engine);
323-
return NULL;
324-
}
325-
engine->pub.enp_ver_tags_len = tag_buf_len;
326315
engine->pub.enp_flags = ENPUB_CAN_SEND;
327316

328317
engine->flags = flags;

src/liblsquic/lsquic_engine_public.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ struct lsquic_engine_public {
2929
*/
3030
ENPUB_CAN_SEND = (1 << 1),
3131
} enp_flags;
32-
unsigned char enp_ver_tags_buf[ sizeof(lsquic_ver_tag_t) * N_LSQVER ];
33-
unsigned enp_ver_tags_len;
3432
};
3533

3634
/* Put connection onto the Tickable Queue if it is not already on it. If

src/liblsquic/lsquic_parse_iquic_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ lsquic_iquic_parse_packet_in_long_begin (lsquic_packet_in_t *packet_in,
9393
* the packet number field and the version tag are the same. The check
9494
* will probably have to be split in the future.
9595
*/
96-
if (end - p < dcil + scil + packet_len)
96+
if (end - p < (ptrdiff_t) (dcil + scil + packet_len))
9797
return -1;
9898

9999
memcpy(&packet_in->pi_conn_id, p, cid_len);
@@ -150,7 +150,7 @@ lsquic_iquic_parse_packet_in_short_begin (lsquic_packet_in_t *packet_in,
150150
return -1;
151151

152152
packet_len = 1 << (*p & 3);
153-
if (pend - p < 1 + cid_len + packet_len)
153+
if (pend - p < (ptrdiff_t) (1 + cid_len + packet_len))
154154
return -1;
155155

156156
++p;

src/liblsquic/lsquic_version.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,26 +69,3 @@ const char *const lsquic_ver2str[N_LSQVER] = {
6969
};
7070

7171

72-
int
73-
lsquic_gen_ver_tags (unsigned char *buf, size_t bufsz, unsigned version_bitmask)
74-
{
75-
unsigned n;
76-
lsquic_ver_tag_t tag;
77-
unsigned char *p = buf;
78-
unsigned char *const pend = p + bufsz;
79-
for (n = 0; version_bitmask; ++n)
80-
{
81-
if (version_bitmask & (1 << n))
82-
{
83-
if (p + 4 > pend)
84-
return -1;
85-
version_bitmask &= ~(1 << n);
86-
tag = lsquic_ver2tag(n);
87-
if (0 == tag)
88-
return -1;
89-
memcpy(p, &tag, 4);
90-
p += 4;
91-
}
92-
}
93-
return p - buf;
94-
}

src/liblsquic/lsquic_version.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,4 @@ lsquic_tag2ver (uint32_t ver_tag);
1616

1717
extern const char *const lsquic_ver2str[];
1818

19-
int
20-
lsquic_gen_ver_tags (unsigned char *buf, size_t bufsz, unsigned versions);
21-
2219
#endif

test/http_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <unistd.h>
2727
#include <sys/types.h>
2828
#include <dirent.h>
29+
#include <limits.h>
2930
#endif
3031
#include <sys/stat.h>
3132
#include <fcntl.h>

0 commit comments

Comments
 (0)