]> git.kaiwu.me - haproxy.git/commitdiff
CLEANUP: Reapply ist.cocci (4)
authorTim Duesterhus <tim@bastelstu.be>
Tue, 28 Apr 2026 19:59:12 +0000 (21:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 29 Apr 2026 02:39:12 +0000 (04:39 +0200)
This reapplies ist.cocci across the whole src/ tree.

src/acme.c
src/haterm.c
src/htx.c
src/tools.c

index 2c662b58871ca7ae9eeb6d4fb268c671c243fb9c..bae7230bb6e2c1c0ab2f571934a1e45b3bbf40cc 100644 (file)
@@ -1978,7 +1978,7 @@ int acme_res_auth(struct task *task, struct acme_ctx *ctx, struct acme_auth *aut
                                line[nmsg++] = ist(ctx->cfg->vars);
                                line[nmsg++] = ist("\"\n");
                        }
-                       if (auth->dns.ptr) {
+                       if (isttest(auth->dns)) {
                                line[nmsg++] = ist("dns-01-record \"");
                                line[nmsg++] = ist2(dns_record->area, dns_record->data);
                                line[nmsg++] = ist("\"\n");
index 939e129a1045871a3a1972638aa912e1e4d1c9d5..89d6d5ab51d31a3f5b087c93d23f59566a9393a6 100644 (file)
@@ -476,7 +476,7 @@ static int hstream_build_http_help_resp(struct hstream *hs)
                goto err;
        }
 
-       if (!htx_add_data_atonce(htx, ist2(HTTP_HELP, strlen(HTTP_HELP)))) {
+       if (!htx_add_data_atonce(htx, ist(HTTP_HELP))) {
                TRACE_ERROR("unable to add payload to HTX message", HS_EV_HSTRM_SEND, hs);
                goto err;
        }
index c045df76611c7acb3cb2719b71b4a66ff8762bb0..3584f9ffb88ff3cfc3ec0798c88052be0798d7c9 100644 (file)
--- a/src/htx.c
+++ b/src/htx.c
@@ -763,8 +763,7 @@ size_t htx_xfer(struct htx *dst, struct htx *src, size_t count, unsigned int fla
                switch (type) {
                case HTX_BLK_DATA:
                        v = htx_get_blk_value(src, blk);
-                       if (v.len > max)
-                               v.len = max;
+                       v = isttrim(v, max);
                        v.len = htx_add_data(dst, v);
                        if (!v.len) {
                                dst_full = 1;
@@ -910,8 +909,7 @@ struct htx_ret htx_xfer_blks(struct htx *dst, struct htx *src, uint32_t count,
                switch (type) {
                        case HTX_BLK_DATA:
                                v = htx_get_blk_value(src, blk);
-                               if (v.len > max)
-                                       v.len = max;
+                               v = isttrim(v, max);
                                v.len = htx_add_data(dst, v);
                                if (!v.len)
                                        goto stop;
index a83a46ac7e60b11ad729cbe6d792a1ba61133841..2687c2cdc4d22c2c2b2c121b29e1525728515f0e 100644 (file)
@@ -6970,7 +6970,7 @@ void update_word_fingerprint_with_len(uint8_t *fp, struct ist word)
        int c;
 
        from = 28; // begin
-       for (p = word.ptr; p < word.ptr + word.len; p++) {
+       for (p = word.ptr; p < istend(word); p++) {
                c = tolower((unsigned char)*p);
                switch(c) {
                case 'a'...'z': to = c - 'a' + 1; break;