]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cache: replace a fprint() by an abort()
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 24 Nov 2017 17:53:42 +0000 (18:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 24 Nov 2017 18:00:07 +0000 (19:00 +0100)
In the applet I/O handler we can never get an object bigger than a
buffer, so we should never reach this case.

src/cache.c

index 5af51f27d52d735856ad33c637eb4fafd15c2e8b..3447038bfe48e1e371950af1bc0b02e644f01d8c 100644 (file)
@@ -560,7 +560,9 @@ static void http_cache_io_handler(struct appctx *appctx)
        if (appctx->st0 == HTTP_CACHE_INIT) {
                int len = first->len - sizeof(struct cache_entry);
                if ((shctx_row_data_get(shctx, first, (unsigned char *)bi_end(res->buf), sizeof(struct cache_entry), len)) != 0) {
-                       fprintf(stderr, "cache error too big: %d\n", first->len - (int)sizeof(struct cache_entry));
+                       /* should never get there, because at the moment, a
+                        * cache object can never be bigger than a buffer */
+                        abort();
 
                        si_applet_cant_put(si);
                        goto out;