]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http: made CHECK_HTTP_MESSAGE_FIRST accessible to other functions
authorJames Rosewell <james@51degrees.com>
Fri, 18 Sep 2015 16:11:16 +0000 (17:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2015 10:05:26 +0000 (12:05 +0200)
Added the definition of CHECK_HTTP_MESSAGE_FIRST and the declaration of
smp_prefetch_http to the header.

Changed smp_prefetch_http implementation to remove the static qualifier.

include/proto/proto_http.h
src/proto_http.c

index d62cd9b9bd11f350785837d210812253ceb87b83..8385dc6932e29205530f9b74f4361038c1d04854 100644 (file)
@@ -135,6 +135,18 @@ struct action_kw *action_http_req_custom(const char *kw);
 struct action_kw *action_http_res_custom(const char *kw);
 int val_hdr(struct arg *arg, char **err_msg);
 
+int smp_prefetch_http(struct proxy *px, struct stream *s, unsigned int opt,
+                  const struct arg *args, struct sample *smp, int req_vol);
+
+/* Note: these functions *do* modify the sample. Even in case of success, at
+ * least the type and uint value are modified.
+ */
+#define CHECK_HTTP_MESSAGE_FIRST() \
+       do { int r = smp_prefetch_http(smp->px, smp->strm, smp->opt, args, smp, 1); if (r <= 0) return r; } while (0)
+
+#define CHECK_HTTP_MESSAGE_FIRST_PERM() \
+       do { int r = smp_prefetch_http(smp->px, smp->strm, smp->opt, args, smp, 0); if (r <= 0) return r; } while (0)
+
 static inline void http_req_keywords_register(struct action_kw_list *kw_list)
 {
        LIST_ADDQ(&http_req_keywords.list, &kw_list->list);
index eb3582bd77be9fb96a0babb0e5390c276c77e50e..0fb57d39d8b40675c07bd74d2ad14a622cb98297 100644 (file)
@@ -10015,8 +10015,7 @@ struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, st
  *     we'll never have any HTTP message there ;
  *   1 if an HTTP message is ready
  */
-static int
-smp_prefetch_http(struct proxy *px, struct stream *s, unsigned int opt,
+int smp_prefetch_http(struct proxy *px, struct stream *s, unsigned int opt,
                   const struct arg *args, struct sample *smp, int req_vol)
 {
        struct http_txn *txn;
@@ -10110,16 +10109,6 @@ smp_prefetch_http(struct proxy *px, struct stream *s, unsigned int opt,
        return 1;
 }
 
-/* Note: these functinos *do* modify the sample. Even in case of success, at
- * least the type and uint value are modified.
- */
-#define CHECK_HTTP_MESSAGE_FIRST() \
-       do { int r = smp_prefetch_http(smp->px, smp->strm, smp->opt, args, smp, 1); if (r <= 0) return r; } while (0)
-
-#define CHECK_HTTP_MESSAGE_FIRST_PERM() \
-       do { int r = smp_prefetch_http(smp->px, smp->strm, smp->opt, args, smp, 0); if (r <= 0) return r; } while (0)
-
-
 /* 1. Check on METHOD
  * We use the pre-parsed method if it is known, and store its number as an
  * integer. If it is unknown, we use the pointer and the length.