]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h2: make sure h1m->err_pos field is correct on chunk error
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Sep 2018 07:05:16 +0000 (09:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Sep 2018 15:38:25 +0000 (17:38 +0200)
This never happens but in case it would, it's better to report the
correct offset of the error instead of a negative value.

src/mux_h2.c

index c1dad4c556cf1848dee7a20d5efd302ff9a2fb4c..4da20070f76eeac66c1e3790a9f2459627637f79 100644 (file)
@@ -3316,7 +3316,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, const struct buffer *buf,
 
                        if (ret < 0) {
                                /* FIXME: bad contents. how to proceed here when we're in H2 ? */
-                               h1m->err_pos = ret;
+                               h1m->err_pos = ofs + max + ret;
                                h2s_error(h2s, H2_ERR_INTERNAL_ERROR);
                                goto end;
                        }
@@ -3334,7 +3334,7 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, const struct buffer *buf,
 
                        if (ret < 0) {
                                /* FIXME: bad contents. how to proceed here when we're in H2 ? */
-                               h1m->err_pos = ret;
+                               h1m->err_pos = ofs + max + ret;
                                h2s_error(h2s, H2_ERR_INTERNAL_ERROR);
                                goto end;
                        }