Skip to content

Commit

Permalink
Bump sfparse
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Nov 17, 2024
1 parent 8828bfd commit 9dadfaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions lib/nghttp3_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ static int is_ws(uint8_t c) {
int nghttp3_http_parse_priority(nghttp3_pri *dest, const uint8_t *value,
size_t valuelen) {
nghttp3_pri pri = *dest;
sf_parser sfp;
sf_vec key;
sf_value val;
sfparse_parser sfp;
sfparse_vec key;
sfparse_value val;
int rv;

sf_parser_init(&sfp, value, valuelen);
sfparse_parser_init(&sfp, value, valuelen);

for (;;) {
rv = sf_parser_dict(&sfp, &key, &val);
rv = sfparse_parser_dict(&sfp, &key, &val);
if (rv != 0) {
if (rv == SF_ERR_EOF) {
if (rv == SFPARSE_ERR_EOF) {
break;
}

Expand All @@ -147,15 +147,16 @@ int nghttp3_http_parse_priority(nghttp3_pri *dest, const uint8_t *value,

switch (key.base[0]) {
case 'i':
if (val.type != SF_TYPE_BOOLEAN) {
if (val.type != SFPARSE_TYPE_BOOLEAN) {
return NGHTTP3_ERR_INVALID_ARGUMENT;
}

pri.inc = (uint8_t)val.boolean;

break;
case 'u':
if (val.type != SF_TYPE_INTEGER || val.integer < NGHTTP3_URGENCY_HIGH ||
if (val.type != SFPARSE_TYPE_INTEGER ||
val.integer < NGHTTP3_URGENCY_HIGH ||
NGHTTP3_URGENCY_LOW < val.integer) {
return NGHTTP3_ERR_INVALID_ARGUMENT;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/sfparse

0 comments on commit 9dadfaf

Please sign in to comment.