CLEANUP: Apply ist.cocci
Make use of the new rules to use `istnext()`.
diff --git a/src/cache.c b/src/cache.c
index feab63f..ba2b63c 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -2180,49 +2180,49 @@
switch (*encoding.ptr) {
case 'a':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "aes128gcm", VARY_ENCODING_AES128GCM);
break;
case 'b':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "br", VARY_ENCODING_BR);
break;
case 'c':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "compress", VARY_ENCODING_COMPRESS);
break;
case 'd':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "deflate", VARY_ENCODING_DEFLATE);
break;
case 'e':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "exi", VARY_ENCODING_EXI);
break;
case 'g':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "gzip", VARY_ENCODING_GZIP);
break;
case 'i':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "identity", VARY_ENCODING_IDENTITY);
break;
case 'p':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "pack200-gzip", VARY_ENCODING_PACK200_GZIP);
break;
case 'x':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "x-gzip", VARY_ENCODING_GZIP);
if (!*encoding_value)
*encoding_value = CHECK_ENCODING(encoding, "x-compress", VARY_ENCODING_COMPRESS);
break;
case 'z':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = CHECK_ENCODING(encoding, "zstd", VARY_ENCODING_ZSTD);
break;
case '*':
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
*encoding_value = VARY_ENCODING_STAR;
break;
default:
@@ -2238,7 +2238,7 @@
return -1;
if (has_null_weight) {
- encoding = istadv(encoding, 1);
+ encoding = istnext(encoding);
encoding = http_trim_leading_spht(encoding);
diff --git a/src/http_htx.c b/src/http_htx.c
index bfdcaef..8028cfc 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -146,8 +146,7 @@
goto next_blk;
/* Skip comma */
if (*(v.ptr) == ',') {
- v.ptr++;
- v.len--;
+ v = istnext(v);
}
goto return_hdr;
@@ -216,8 +215,7 @@
ctx->lws_before = 0;
ctx->lws_after = 0;
while (v.len && HTTP_IS_LWS(*v.ptr)) {
- v.ptr++;
- v.len--;
+ v = istnext(v);
ctx->lws_before++;
}
if (!(flags & HTTP_FIND_FL_FULL))
@@ -457,16 +455,14 @@
uri = htx_sl_req_uri(sl);
q = uri;
while (q.len > 0 && *(q.ptr) != '?') {
- q.ptr++;
- q.len--;
+ q = istnext(q);
}
/* skip the question mark or indicate that we must insert it
* (but only if the format string is not empty then).
*/
if (q.len) {
- q.ptr++;
- q.len--;
+ q = istnext(q);
}
else if (query.len > 1)
offset = 0;
diff --git a/src/mqtt.c b/src/mqtt.c
index 6624201..ebdb57d 100644
--- a/src/mqtt.c
+++ b/src/mqtt.c
@@ -183,7 +183,7 @@
return IST_NULL;
if (i)
*i = (uint8_t)*istptr(parser);
- parser = istadv(parser, 1);
+ parser = istnext(parser);
return parser;
}