}
/* Returns the maximum integer which may be encoded with <size> bytes */
-static inline size_t quic_max_int_by_size(int size)
+static inline uint64_t quic_max_int_by_size(int size)
{
switch (size) {
case 1:
chunk_appendf(&trace_buf, " : qcc=%p(F)", qcc);
if (qcs)
- chunk_appendf(&trace_buf, " qcs=%p(%lu)", qcs, qcs->id);
+ chunk_appendf(&trace_buf, " qcs=%p(%llu)", qcs, (ull)qcs->id);
}
}
{
switch (frm->type) {
case QUIC_FT_MAX_STREAMS_BIDI:
- chunk_appendf(&trace_buf, " max_streams=%lu",
- frm->max_streams_bidi.max_streams);
+ chunk_appendf(&trace_buf, " max_streams=%llu",
+ (ull)frm->max_streams_bidi.max_streams);
break;
case QUIC_FT_MAX_STREAMS_UNI:
- chunk_appendf(&trace_buf, " max_streams=%lu",
- frm->max_streams_uni.max_streams);
+ chunk_appendf(&trace_buf, " max_streams=%llu",
+ (ull)frm->max_streams_uni.max_streams);
break;
default:
chunk_appendf(&trace_buf, " : qcc=%p(F)", qcc);
if (qcs)
- chunk_appendf(&trace_buf, " qcs=%p(%lu)", qcs, qcs->id);
+ chunk_appendf(&trace_buf, " qcs=%p(%llu)", qcs, (ull)qcs->id);
if (mask & QMUX_EV_QCC_NQCS) {
const uint64_t *id = a3;
- chunk_appendf(&trace_buf, " id=%lu", *id);
+ chunk_appendf(&trace_buf, " id=%llu", (ull)*id);
}
if (mask & QMUX_EV_SEND_FRM)
if (mask & QMUX_EV_QCS_XFER_DATA) {
const struct qcs_xfer_data_trace_arg *arg = a3;
- chunk_appendf(&trace_buf, " prep=%lu xfer=%d",
- arg->prep, arg->xfer);
+ chunk_appendf(&trace_buf, " prep=%llu xfer=%d",
+ (ull)arg->prep, arg->xfer);
}
if (mask & QMUX_EV_QCS_BUILD_STRM) {
const struct qcs_build_stream_trace_arg *arg = a3;
- chunk_appendf(&trace_buf, " len=%lu fin=%d offset=%lu",
- arg->len, arg->fin, arg->offset);
+ chunk_appendf(&trace_buf, " len=%llu fin=%d offset=%llu",
+ (ull)arg->len, arg->fin, (ull)arg->offset);
}
}
}
* Return a negative error if failed, 0 if not.
*/
static int qpack_decode_fs_pfx(uint64_t *enc_ric, uint64_t *db, int *sign_bit,
- const unsigned char **raw, size_t *len)
+ const unsigned char **raw, uint64_t *len)
{
*enc_ric = qpack_get_varint(raw, len, 8);
if (*len == (uint64_t)-1)
* Returns the number of headers inserted into list excluding the end marker.
* In case of error, a negative code QPACK_ERR_* is returned.
*/
-int qpack_decode_fs(const unsigned char *raw, size_t len, struct buffer *tmp,
+int qpack_decode_fs(const unsigned char *raw, uint64_t len, struct buffer *tmp,
struct http_hdr *list, int list_size)
{
struct ist name, value;
case QUIC_FT_CONNECTION_CLOSE:
{
const struct quic_connection_close *cc = &frm->connection_close;
- size_t plen = QUIC_MIN(cc->reason_phrase_len, sizeof cc->reason_phrase);
+ size_t plen = QUIC_MIN((size_t)cc->reason_phrase_len, sizeof cc->reason_phrase);
chunk_appendf(&trace_buf,
" error_code=%llu frame_type=%llu reason_phrase_len=%llu",
(ull)cc->error_code, (ull)cc->frame_type,
case QUIC_FT_CONNECTION_CLOSE_APP:
{
const struct quic_connection_close_app *cc = &frm->connection_close_app;
- size_t plen = QUIC_MIN(cc->reason_phrase_len, sizeof cc->reason_phrase);
+ size_t plen = QUIC_MIN((size_t)cc->reason_phrase_len, sizeof cc->reason_phrase);
chunk_appendf(&trace_buf,
" error_code=%llu reason_phrase_len=%llu",
(ull)cc->error_code, (ull)cc->reason_phrase_len);
end - *buf < cc->reason_phrase_len)
return 0;
- plen = QUIC_MIN(cc->reason_phrase_len, sizeof cc->reason_phrase);
+ plen = QUIC_MIN((size_t)cc->reason_phrase_len, sizeof cc->reason_phrase);
memcpy(cc->reason_phrase, *buf, plen);
*buf += cc->reason_phrase_len;
end - *buf < cc->reason_phrase_len)
return 0;
- plen = QUIC_MIN(cc->reason_phrase_len, sizeof cc->reason_phrase);
+ plen = QUIC_MIN((size_t)cc->reason_phrase_len, sizeof cc->reason_phrase);
memcpy(cc->reason_phrase, *buf, plen);
*buf += cc->reason_phrase_len;
/* Leave room for the datagram header */
pos += dg_headlen;
if (!quic_peer_validated_addr(qc) && qc_is_listener(qc)) {
- end = pos + QUIC_MIN(qc->path->mtu, 3 * qc->rx.bytes - qc->tx.prep_bytes);
+ end = pos + QUIC_MIN((uint64_t)qc->path->mtu, 3 * qc->rx.bytes - qc->tx.prep_bytes);
}
else {
end = pos + qc->path->mtu;
/* Leave room for the datagram header */
pos += dg_headlen;
if (!quic_peer_validated_addr(qc) && qc_is_listener(qc)) {
- end = pos + QUIC_MIN(qc->path->mtu, 3 * qc->rx.bytes - qc->tx.prep_bytes);
+ end = pos + QUIC_MIN((uint64_t)qc->path->mtu, 3 * qc->rx.bytes - qc->tx.prep_bytes);
}
else {
end = pos + qc->path->mtu;
flen = hlen + dlen_sz + dlen;
}
else {
- dlen = QUIC_MIN(avail_room, cf->stream.len);
+ dlen = QUIC_MIN((uint64_t)avail_room, cf->stream.len);
flen = hlen + dlen;
}
TRACE_PROTO(" STREAM data length (hlen, stream.len, dlen)",