MINOR: ist: Add `IST_NULL` macro
`IST_NULL` is equivalent to an `struct ist` with `.ptr = NULL` and
`.len = 0`.
diff --git a/src/hpack-dec.c b/src/hpack-dec.c
index a721fad..b4d8f0d 100644
--- a/src/hpack-dec.c
+++ b/src/hpack-dec.c
@@ -406,7 +406,7 @@
value = ist2(vtrash, vlen);
}
- name = ist2(NULL, 0);
+ name = IST_NULL;
if (!must_index)
name.len = hpack_idx_to_phdr(idx);
@@ -458,7 +458,7 @@
}
/* put an end marker */
- list[ret].n = list[ret].v = ist2(NULL, 0);
+ list[ret].n = list[ret].v = IST_NULL;
ret++;
leave:
diff --git a/src/http.c b/src/http.c
index 7525199..ec6b4a2 100644
--- a/src/http.c
+++ b/src/http.c
@@ -551,7 +551,7 @@
return ist2(start, end - start);
not_found:
- return ist2(NULL, 0);
+ return IST_NULL;
}
/* Parse the URI from the given transaction (which is assumed to be in request
@@ -601,7 +601,7 @@
return ist2(ptr, end - ptr);
not_found:
- return ist2(NULL, 0);
+ return IST_NULL;
}
/*
diff --git a/src/http_htx.c b/src/http_htx.c
index 35bb056..8157eb5 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -533,7 +533,7 @@
blk = htx_remove_blk(htx, blk);
if (blk || htx_is_empty(htx)) {
ctx->blk = blk;
- ctx->value = ist2(NULL, 0);
+ ctx->value = IST_NULL;
ctx->lws_before = ctx->lws_after = 0;
}
else {