litespeed-quic/test/unittests/test_alt_svc_ver.c
Dmitri Tikhonov fb96f4dd43 Release 2.9.0
- [API] Drop support for Q039.
- Improve ACK-queuing logic.  Send an ACK once in a while if
  peer keeps on sending non-ack-eliciting packets.
- Improve Alt-Svc string: Q050 and later are not included in
  the old-style "quic" string.
- Send stateless resets if connection could not be promoted.
- Schedule MAX_DATA if needed when DATA_BLOCKED is received.
- Use ls-qpack 0.11.2 -- needed for server push optimization.
- Code cleanup: handle some error cases, improve logging.
2020-01-20 09:41:37 -05:00

18 lines
658 B
C

/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc. See LICENSE. */
#include <assert.h>
#include <string.h>
#include "lsquic.h"
#define B(x) (1<<(x))
int
main (void)
{
assert(0 == strcmp("", lsquic_get_alt_svc_versions(0xF000))); /* Invalid bits ignored and no crash */
assert(0 == strcmp("43", lsquic_get_alt_svc_versions(B(LSQVER_043))));
assert(0 == strcmp("43,46", lsquic_get_alt_svc_versions(B(LSQVER_046)|B(LSQVER_043))));
assert(0 == strcmp("43,46", lsquic_get_alt_svc_versions(0xFF0000|B(LSQVER_046)|B(LSQVER_043))));
assert(0 == strcmp("46", lsquic_get_alt_svc_versions(B(LSQVER_046)|B(LSQVER_050))));
return 0;
}