]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: spoa: Update pointer on the end of the frame when a reply is encoded
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 Sep 2017 09:49:23 +0000 (11:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 10:36:12 +0000 (11:36 +0100)
The same buffer is used for a request and its response. So we need to be sure
to correctly reset info when the response is encoded. And here there was a
bug. The pointer on the end of the frame was not updated.  So it was not
possible to encode a response bigger than the corresponding request.

contrib/spoa_example/spoa.c

index 8fb62e022fcef01315b2cc93bc55e78ee2ba0e56..351313adea28bfb6ffe82e502af4a0dacded7458 100644 (file)
@@ -1358,7 +1358,8 @@ process_frame_cb(evutil_socket_t fd, short events, void *arg)
        frame->flags  = 0;
 
        ret = prepare_agentack(frame);
-       p = frame->buf + ret;
+       p   = frame->buf + ret;
+       end = frame->buf+max_frame_size;
 
        if (frame->ip_score != -1) {
                DEBUG(frame->worker, "Add action : set variable ip_scode=%u",