]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] stats: don't call buffer_shutw(), but ->shutw() instead
authorWilly Tarreau <w@1wt.eu>
Sun, 4 Oct 2009 07:16:41 +0000 (09:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 4 Oct 2009 07:19:36 +0000 (09:19 +0200)
Calling buffer_shutw() marks the buffer as closed but if it was already
closed in the other direction, the stream interface is not marked as
closed, causing infinite loops.

We took this opportunity to completely remove buffer_shutw() and buffer_shutr()
which have no reason to be used at all and which will always cause trouble
when directly called. The stats occurrence was the last one.

include/proto/buffers.h
src/dumpstats.c

index a20ae8ba14ab6b44be4aa7f06b68c4a81a90571e..cec7b02fbbf9968e48eb6e0fbc44fdf7c94e6534 100644 (file)
@@ -163,20 +163,6 @@ static inline void buffer_cut_tail(struct buffer *buf)
                buf->flags |= BF_FULL;
 }
 
-/* marks the buffer as "shutdown" for reads and cancels the timeout */
-static inline void buffer_shutr(struct buffer *buf)
-{
-       buf->rex = TICK_ETERNITY;
-       buf->flags |= BF_SHUTR;
-}
-
-/* marks the buffer as "shutdown" for writes and cancels the timeout */
-static inline void buffer_shutw(struct buffer *buf)
-{
-       buf->wex = TICK_ETERNITY;
-       buf->flags |= BF_SHUTW;
-}
-
 /* marks the buffer as "shutdown" ASAP for reads */
 static inline void buffer_shutr_now(struct buffer *buf)
 {
index f9d8785b4df05b5d6d3382b2c0e3e6ea1bc77768..b34b8499784335252203bc3dad6436a8c7c63e9b 100644 (file)
@@ -467,11 +467,10 @@ void stats_io_handler(struct stream_interface *si)
                        s->ana_state = STATS_ST_REQ;
                }
                else if (s->ana_state == STATS_ST_CLOSE) {
-                       /* let's close for real now. Note that we may as well
-                        * call shutw+shutr, but this is enough since the shut
-                        * conditions below will complete.
+                       /* Let's close for real now. We just close the request
+                        * side, the conditions below will complete if needed.
                         */
-                       buffer_shutw(si->ob);
+                       si->shutw(si);
                        s->ana_state = 0;
                        break;
                }