MINOR: http: made CHECK_HTTP_MESSAGE_FIRST accessible to other functions

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.
This commit is contained in:
James Rosewell 2015-09-18 17:11:16 +01:00 committed by Willy Tarreau
parent 11e334d972
commit 91a41cb32d
2 changed files with 13 additions and 12 deletions

View 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);

View 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.