]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] ensure we can jump from swiching rules to http without data
authorWilly Tarreau <w@1wt.eu>
Sun, 12 Jul 2009 07:55:41 +0000 (09:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 12 Jul 2009 07:55:41 +0000 (09:55 +0200)
In case of switching from TCP to HTTP, we want the HTTP request timeout
to be properly initialized. For this, we have to jump to the analyser
without breaking out of the loop nor waiting for incoming data. The way
it is done right now is not particularly clean but it works.

A cleaner method might involve pushing function pointers into a circular
list.

src/session.c

index 7d95669fb4df22bc6cdb0b8cc1038d7eabbc86e3..af6061f59822ea84e4abbcc3e5a7f20942d898a6 100644 (file)
@@ -818,6 +818,13 @@ resync_stream_interface:
                                        last_ana |= AN_REQ_SWITCHING_RULES;
                                        if (!process_switching_rules(s, s->req, AN_REQ_SWITCHING_RULES))
                                                break;
+                                       /* FIXME: we mait switch from TCP to HTTP and want to
+                                        * immediately loop back to the top. This is a dirty way
+                                        * of doing it, and we should find a cleaner method relying
+                                        * on a circular list of function pointers.
+                                        */
+                                       if ((s->req->analysers & ~last_ana) & AN_REQ_WAIT_HTTP)
+                                               continue;
                                }
 
                                if (s->req->analysers & AN_REQ_HTTP_PROCESS_BE) {