REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files
The old module proto_http does not exist anymore. All code dedicated to the HTTP
analysis is now grouped in the file proto_htx.c. So, to finish the polishing
after removing the legacy HTTP code, proto_htx.{c,h} files have been moved in
http_ana.{c,h} files.
In addition, all HTX analyzers and related functions prefixed with "htx_" have
been renamed to start with "http_" instead.
diff --git a/Makefile b/Makefile
index 950cee5..419d3ea 100644
--- a/Makefile
+++ b/Makefile
@@ -756,7 +756,7 @@
endif
endif
-OBJS = src/proto_http.o src/cfgparse-listen.o src/proto_htx.o src/stream.o \
+OBJS = src/http_ana.o src/cfgparse-listen.o src/stream.o \
src/mux_h2.o src/stats.o src/flt_spoe.o src/server.o src/checks.o \
src/haproxy.o src/cfgparse.o src/flt_http_comp.o src/http_fetch.o \
src/dns.o src/stick_table.o src/mux_h1.o src/peers.o src/standard.o \
diff --git a/contrib/debug/flags.c b/contrib/debug/flags.c
index 0e67155..1a17c7f 100644
--- a/contrib/debug/flags.c
+++ b/contrib/debug/flags.c
@@ -3,7 +3,7 @@
#include <types/channel.h>
#include <types/connection.h>
-#include <types/proto_http.h>
+#include <types/http_ana.h>
#include <types/stream.h>
#include <types/stream_interface.h>
#include <types/task.h>
diff --git a/include/proto/filters.h b/include/proto/filters.h
index 256270f..3deb2d1 100644
--- a/include/proto/filters.h
+++ b/include/proto/filters.h
@@ -23,7 +23,7 @@
#include <types/channel.h>
#include <types/filters.h>
-#include <types/proto_http.h>
+#include <types/http_ana.h>
#include <types/proxy.h>
#include <types/stream.h>
diff --git a/include/proto/http_ana.h b/include/proto/http_ana.h
new file mode 100644
index 0000000..66895f4
--- /dev/null
+++ b/include/proto/http_ana.h
@@ -0,0 +1,87 @@
+/*
+ * include/proto/http_ana.h
+ * This file contains HTTP protocol definitions.
+ *
+ * Copyright (C) 2000-2011 Willy Tarreau - w@1wt.eu
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _PROTO_PROTO_HTTP_H
+#define _PROTO_PROTO_HTTP_H
+
+#include <common/config.h>
+#include <common/htx.h>
+#include <types/channel.h>
+#include <types/http_ana.h>
+#include <types/stream.h>
+
+extern struct pool_head *pool_head_uniqueid;
+
+int http_wait_for_request(struct stream *s, struct channel *req, int an_bit);
+int http_process_req_common(struct stream *s, struct channel *req, int an_bit, struct proxy *px);
+int http_process_request(struct stream *s, struct channel *req, int an_bit);
+int http_process_tarpit(struct stream *s, struct channel *req, int an_bit);
+int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit);
+int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit);
+int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, struct proxy *px);
+int http_request_forward_body(struct stream *s, struct channel *req, int an_bit);
+int http_response_forward_body(struct stream *s, struct channel *res, int an_bit);
+int http_apply_redirect_rule(struct redirect_rule *rule, struct stream *s, struct http_txn *txn);
+int http_transform_header_str(struct stream* s, struct channel *chn, struct htx *htx,
+ struct ist name, const char *str, struct my_regex *re, int action);
+int http_req_replace_stline(int action, const char *replace, int len,
+ struct proxy *px, struct stream *s);
+void http_res_set_status(unsigned int status, const char *reason, struct stream *s);
+void http_check_request_for_cacheability(struct stream *s, struct channel *req);
+void http_check_response_for_cacheability(struct stream *s, struct channel *res);
+int http_send_name_header(struct stream *s, struct proxy *be, const char *srv_name);
+void http_perform_server_redirect(struct stream *s, struct stream_interface *si);
+void http_server_error(struct stream *s, struct stream_interface *si, int err, int finst, const struct buffer *msg);
+void http_reply_and_close(struct stream *s, short status, struct buffer *msg);
+void http_return_srv_error(struct stream *s, struct stream_interface *si);
+struct buffer *http_error_message(struct stream *s);
+
+struct http_txn *http_alloc_txn(struct stream *s);
+void http_init_txn(struct stream *s);
+void http_end_txn(struct stream *s);
+void http_reset_txn(struct stream *s);
+
+/* for debugging, reports the HTTP/1 message state name (legacy version) */
+static inline const char *h1_msg_state_str(enum h1_state msg_state)
+{
+ switch (msg_state) {
+ case HTTP_MSG_RQBEFORE: return "MSG_RQBEFORE";
+ case HTTP_MSG_RPBEFORE: return "MSG_RPBEFORE";
+ case HTTP_MSG_ERROR: return "MSG_ERROR";
+ case HTTP_MSG_BODY: return "MSG_BODY";
+ case HTTP_MSG_DATA: return "MSG_DATA";
+ case HTTP_MSG_ENDING: return "MSG_ENDING";
+ case HTTP_MSG_DONE: return "MSG_DONE";
+ case HTTP_MSG_CLOSING: return "MSG_CLOSING";
+ case HTTP_MSG_CLOSED: return "MSG_CLOSED";
+ case HTTP_MSG_TUNNEL: return "MSG_TUNNEL";
+ default: return "MSG_??????";
+ }
+}
+
+#endif /* _PROTO_PROTO_HTTP_H */
+
+/*
+ * Local variables:
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h
deleted file mode 100644
index ea8932c..0000000
--- a/include/proto/proto_http.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * include/proto/proto_http.h
- * This file contains HTTP protocol definitions.
- *
- * Copyright (C) 2000-2011 Willy Tarreau - w@1wt.eu
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation, version 2.1
- * exclusively.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _PROTO_PROTO_HTTP_H
-#define _PROTO_PROTO_HTTP_H
-
-#include <common/config.h>
-#include <common/htx.h>
-#include <types/channel.h>
-#include <types/proto_http.h>
-#include <types/stream.h>
-
-extern struct pool_head *pool_head_uniqueid;
-
-int htx_wait_for_request(struct stream *s, struct channel *req, int an_bit);
-int htx_process_req_common(struct stream *s, struct channel *req, int an_bit, struct proxy *px);
-int htx_process_request(struct stream *s, struct channel *req, int an_bit);
-int htx_process_tarpit(struct stream *s, struct channel *req, int an_bit);
-int htx_wait_for_request_body(struct stream *s, struct channel *req, int an_bit);
-int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit);
-int htx_process_res_common(struct stream *s, struct channel *rep, int an_bit, struct proxy *px);
-int htx_request_forward_body(struct stream *s, struct channel *req, int an_bit);
-int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit);
-int htx_apply_redirect_rule(struct redirect_rule *rule, struct stream *s, struct http_txn *txn);
-int htx_transform_header_str(struct stream* s, struct channel *chn, struct htx *htx,
- struct ist name, const char *str, struct my_regex *re, int action);
-int htx_req_replace_stline(int action, const char *replace, int len,
- struct proxy *px, struct stream *s);
-void htx_res_set_status(unsigned int status, const char *reason, struct stream *s);
-void htx_check_request_for_cacheability(struct stream *s, struct channel *req);
-void htx_check_response_for_cacheability(struct stream *s, struct channel *res);
-int htx_send_name_header(struct stream *s, struct proxy *be, const char *srv_name);
-void htx_perform_server_redirect(struct stream *s, struct stream_interface *si);
-void htx_server_error(struct stream *s, struct stream_interface *si, int err, int finst, const struct buffer *msg);
-void htx_reply_and_close(struct stream *s, short status, struct buffer *msg);
-void htx_return_srv_error(struct stream *s, struct stream_interface *si);
-struct buffer *htx_error_message(struct stream *s);
-
-struct http_txn *http_alloc_txn(struct stream *s);
-void http_init_txn(struct stream *s);
-void http_end_txn(struct stream *s);
-void http_reset_txn(struct stream *s);
-
-/* for debugging, reports the HTTP/1 message state name (legacy version) */
-static inline const char *h1_msg_state_str(enum h1_state msg_state)
-{
- switch (msg_state) {
- case HTTP_MSG_RQBEFORE: return "MSG_RQBEFORE";
- case HTTP_MSG_RPBEFORE: return "MSG_RPBEFORE";
- case HTTP_MSG_ERROR: return "MSG_ERROR";
- case HTTP_MSG_BODY: return "MSG_BODY";
- case HTTP_MSG_DATA: return "MSG_DATA";
- case HTTP_MSG_ENDING: return "MSG_ENDING";
- case HTTP_MSG_DONE: return "MSG_DONE";
- case HTTP_MSG_CLOSING: return "MSG_CLOSING";
- case HTTP_MSG_CLOSED: return "MSG_CLOSED";
- case HTTP_MSG_TUNNEL: return "MSG_TUNNEL";
- default: return "MSG_??????";
- }
-}
-
-#endif /* _PROTO_PROTO_HTTP_H */
-
-/*
- * Local variables:
- * c-indent-level: 8
- * c-basic-offset: 8
- * End:
- */
diff --git a/include/types/hlua.h b/include/types/hlua.h
index 70c7685..6a78292 100644
--- a/include/types/hlua.h
+++ b/include/types/hlua.h
@@ -9,7 +9,7 @@
#include <common/regex.h>
#include <common/xref.h>
-#include <types/proto_http.h>
+#include <types/http_ana.h>
#include <types/proxy.h>
#include <types/server.h>
#include <types/stick_table.h>
diff --git a/include/types/proto_http.h b/include/types/http_ana.h
similarity index 99%
rename from include/types/proto_http.h
rename to include/types/http_ana.h
index 5125879..4173725 100644
--- a/include/types/proto_http.h
+++ b/include/types/http_ana.h
@@ -1,5 +1,5 @@
/*
- * include/types/proto_http.h
+ * include/types/http_ana.h
* This file contains HTTP protocol definitions.
*
* Copyright (C) 2000-2011 Willy Tarreau - w@1wt.eu
diff --git a/include/types/stream.h b/include/types/stream.h
index 114b70a..c889345 100644
--- a/include/types/stream.h
+++ b/include/types/stream.h
@@ -35,7 +35,7 @@
#include <types/filters.h>
#include <types/hlua.h>
#include <types/obj_type.h>
-#include <types/proto_http.h>
+#include <types/http_ana.h>
#include <types/proxy.h>
#include <types/queue.h>
#include <types/server.h>
diff --git a/src/51d.c b/src/51d.c
index 852c574..96bbb66 100644
--- a/src/51d.c
+++ b/src/51d.c
@@ -11,7 +11,7 @@
#include <proto/http_fetch.h>
#include <proto/http_htx.h>
#include <proto/log.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/sample.h>
#include <import/xxhash.h>
#include <import/lru.h>
diff --git a/src/backend.c b/src/backend.c
index f07a198..169481c 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -48,7 +48,7 @@
#include <proto/obj_type.h>
#include <proto/payload.h>
#include <proto/protocol.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proto_tcp.h>
#include <proto/proxy.h>
#include <proto/queue.h>
diff --git a/src/cache.c b/src/cache.c
index 032c980..ccbbe52 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -25,7 +25,7 @@
#include <proto/http_htx.h>
#include <proto/filters.h>
#include <proto/http_rules.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/log.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
@@ -596,7 +596,7 @@
if (http_find_header(htx, ist("Vary"), &ctx, 0))
goto out;
- htx_check_response_for_cacheability(s, &s->res);
+ http_check_response_for_cacheability(s, &s->res);
if (!(txn->flags & TX_CACHEABLE) || !(txn->flags & TX_CACHE_COOK))
goto out;
@@ -1089,7 +1089,7 @@
(txn->meth != HTTP_METH_GET && txn->meth != HTTP_METH_HEAD))
txn->flags |= TX_CACHE_IGNORE;
- htx_check_request_for_cacheability(s, &s->req);
+ http_check_request_for_cacheability(s, &s->req);
if ((s->txn->flags & (TX_CACHE_IGNORE|TX_CACHEABLE)) == TX_CACHE_IGNORE)
return ACT_RET_CONT;
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 11cb0c1..cb3279a 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -72,7 +72,7 @@
#include <proto/listener.h>
#include <proto/log.h>
#include <proto/protocol.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/peers.h>
#include <proto/sample.h>
diff --git a/src/da.c b/src/da.c
index 2b4ac28..0984c30 100644
--- a/src/da.c
+++ b/src/da.c
@@ -9,7 +9,7 @@
#include <proto/http_fetch.h>
#include <proto/http_htx.h>
#include <proto/log.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/sample.h>
#include <dac.h>
diff --git a/src/dns.c b/src/dns.c
index 503eb67..d59e96e 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -39,7 +39,7 @@
#include <proto/checks.h>
#include <proto/dns.h>
#include <proto/fd.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/http_rules.h>
#include <proto/log.h>
#include <proto/sample.h>
diff --git a/src/filters.c b/src/filters.c
index c68319b..0119205 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -23,13 +23,13 @@
#include <common/hathreads.h>
#include <types/filters.h>
-#include <types/proto_http.h>
+#include <types/http_ana.h>
#include <proto/compression.h>
#include <proto/filters.h>
#include <proto/flt_http_comp.h>
#include <proto/http_htx.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/stream.h>
#include <proto/stream_interface.h>
@@ -1014,10 +1014,10 @@
if (IS_HTX_STRM(s)) {
/* Do not do that when we are waiting for the next request */
if (s->txn->status)
- htx_reply_and_close(s, s->txn->status, NULL);
+ http_reply_and_close(s, s->txn->status, NULL);
else {
s->txn->status = 400;
- htx_reply_and_close(s, 400, htx_error_message(s));
+ http_reply_and_close(s, 400, http_error_message(s));
}
}
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index 446e3c3..91138d6 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -25,7 +25,7 @@
#include <proto/compression.h>
#include <proto/filters.h>
#include <proto/http_htx.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/sample.h>
#include <proto/stream.h>
diff --git a/src/flt_spoe.c b/src/flt_spoe.c
index 4e48aa95..b8323f6 100644
--- a/src/flt_spoe.c
+++ b/src/flt_spoe.c
@@ -34,7 +34,7 @@
#include <proto/frontend.h>
#include <proto/http_rules.h>
#include <proto/log.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/sample.h>
#include <proto/session.h>
diff --git a/src/flt_trace.c b/src/flt_trace.c
index 4d53bfc..1ef7231 100644
--- a/src/flt_trace.c
+++ b/src/flt_trace.c
@@ -28,7 +28,7 @@
#include <proto/filters.h>
#include <proto/http_htx.h>
#include <proto/log.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/stream.h>
const char *trace_flt_id = "trace filter";
diff --git a/src/frontend.c b/src/frontend.c
index f560c16..47a9b1d 100644
--- a/src/frontend.c
+++ b/src/frontend.c
@@ -39,7 +39,7 @@
#include <proto/frontend.h>
#include <proto/log.h>
#include <proto/proto_tcp.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/sample.h>
#include <proto/stream.h>
diff --git a/src/haproxy.c b/src/haproxy.c
index e1b56e0..4e24ca3 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -115,7 +115,7 @@
#include <proto/mworker.h>
#include <proto/pattern.h>
#include <proto/protocol.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/queue.h>
#include <proto/server.h>
diff --git a/src/hlua.c b/src/hlua.c
index 78c6235..aca3cc9 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -52,7 +52,7 @@
#include <proto/queue.h>
#include <proto/pattern.h>
#include <proto/payload.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/sample.h>
#include <proto/server.h>
#include <proto/session.h>
@@ -4831,7 +4831,7 @@
WILL_LJMP(luaL_argerror(L, 3, "invalid regex"));
htx = htxbuf(&msg->chn->buf);
- htx_transform_header_str(htxn->s, msg->chn, htx, ist2(name, name_len), value, re, action);
+ http_transform_header_str(htxn->s, msg->chn, htx, ist2(name, name_len), value, re, action);
regex_free(re);
return 0;
}
@@ -4977,7 +4977,7 @@
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- lua_pushboolean(L, htx_req_replace_stline(0, name, name_len, htxn->p, htxn->s) != -1);
+ lua_pushboolean(L, http_req_replace_stline(0, name, name_len, htxn->p, htxn->s) != -1);
return 1;
}
@@ -4988,7 +4988,7 @@
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- lua_pushboolean(L, htx_req_replace_stline(1, name, name_len, htxn->p, htxn->s) != -1);
+ lua_pushboolean(L, http_req_replace_stline(1, name, name_len, htxn->p, htxn->s) != -1);
return 1;
}
@@ -5012,7 +5012,7 @@
trash.data += name_len;
lua_pushboolean(L,
- htx_req_replace_stline(2, trash.area, trash.data, htxn->p, htxn->s) != -1);
+ http_req_replace_stline(2, trash.area, trash.data, htxn->p, htxn->s) != -1);
return 1;
}
@@ -5023,7 +5023,7 @@
size_t name_len;
const char *name = MAY_LJMP(luaL_checklstring(L, 2, &name_len));
- lua_pushboolean(L, htx_req_replace_stline(3, name, name_len, htxn->p, htxn->s) != -1);
+ lua_pushboolean(L, http_req_replace_stline(3, name, name_len, htxn->p, htxn->s) != -1);
return 1;
}
@@ -5034,7 +5034,7 @@
unsigned int code = MAY_LJMP(luaL_checkinteger(L, 2));
const char *reason = MAY_LJMP(luaL_optlstring(L, 3, NULL, NULL));
- htx_res_set_status(code, reason, htxn->s);
+ http_res_set_status(code, reason, htxn->s);
return 0;
}
@@ -5409,7 +5409,7 @@
oc = &htxn->s->res;
if (IS_HTX_STRM(htxn->s))
- htx_reply_and_close(htxn->s, 0, NULL);
+ http_reply_and_close(htxn->s, 0, NULL);
else {
channel_auto_read(ic);
channel_abort(ic);
diff --git a/src/http_act.c b/src/http_act.c
index 495ba55..d6015d3 100644
--- a/src/http_act.c
+++ b/src/http_act.c
@@ -34,7 +34,7 @@
#include <proto/http_rules.h>
#include <proto/http_htx.h>
#include <proto/log.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/stream_interface.h>
@@ -62,8 +62,8 @@
replace->size - replace->data,
&rule->arg.http.logfmt);
- htx_req_replace_stline(rule->arg.http.action, replace->area,
- replace->data, px, s);
+ http_req_replace_stline(rule->arg.http.action, replace->area,
+ replace->data, px, s);
ret = ACT_RET_CONT;
@@ -162,7 +162,7 @@
goto leave;
/* 3 is the set-uri action */
- htx_req_replace_stline(3, output->area, len, px, s);
+ http_req_replace_stline(3, output->area, len, px, s);
ret = ACT_RET_CONT;
@@ -215,7 +215,7 @@
static enum act_return action_http_set_status(struct act_rule *rule, struct proxy *px,
struct session *sess, struct stream *s, int flags)
{
- htx_res_set_status(rule->arg.status.code, rule->arg.status.reason, s);
+ http_res_set_status(rule->arg.status.code, rule->arg.status.reason, s);
return ACT_RET_CONT;
}
diff --git a/src/proto_htx.c b/src/http_ana.c
similarity index 93%
rename from src/proto_htx.c
rename to src/http_ana.c
index a63efff..fc03751 100644
--- a/src/proto_htx.c
+++ b/src/http_ana.c
@@ -27,7 +27,7 @@
#include <proto/http_htx.h>
#include <proto/log.h>
#include <proto/pattern.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/server.h>
#include <proto/stream.h>
@@ -41,31 +41,31 @@
struct pool_head *pool_head_capture = NULL;
-static void htx_end_request(struct stream *s);
-static void htx_end_response(struct stream *s);
+static void http_end_request(struct stream *s);
+static void http_end_response(struct stream *s);
-static void htx_capture_headers(struct htx *htx, char **cap, struct cap_hdr *cap_hdr);
-static int htx_del_hdr_value(char *start, char *end, char **from, char *next);
-static size_t htx_fmt_req_line(const struct htx_sl *sl, char *str, size_t len);
-static size_t htx_fmt_res_line(const struct htx_sl *sl, char *str, size_t len);
-static void htx_debug_stline(const char *dir, struct stream *s, const struct htx_sl *sl);
-static void htx_debug_hdr(const char *dir, struct stream *s, const struct ist n, const struct ist v);
+static void http_capture_headers(struct htx *htx, char **cap, struct cap_hdr *cap_hdr);
+static int http_del_hdr_value(char *start, char *end, char **from, char *next);
+static size_t http_fmt_req_line(const struct htx_sl *sl, char *str, size_t len);
+static size_t http_fmt_res_line(const struct htx_sl *sl, char *str, size_t len);
+static void http_debug_stline(const char *dir, struct stream *s, const struct htx_sl *sl);
+static void http_debug_hdr(const char *dir, struct stream *s, const struct ist n, const struct ist v);
-static enum rule_result htx_req_get_intercept_rule(struct proxy *px, struct list *rules, struct stream *s, int *deny_status);
-static enum rule_result htx_res_get_intercept_rule(struct proxy *px, struct list *rules, struct stream *s);
+static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct list *rules, struct stream *s, int *deny_status);
+static enum rule_result http_res_get_intercept_rule(struct proxy *px, struct list *rules, struct stream *s);
-static int htx_apply_filters_to_request(struct stream *s, struct channel *req, struct proxy *px);
-static int htx_apply_filters_to_response(struct stream *s, struct channel *res, struct proxy *px);
+static int http_apply_filters_to_request(struct stream *s, struct channel *req, struct proxy *px);
+static int http_apply_filters_to_response(struct stream *s, struct channel *res, struct proxy *px);
-static void htx_manage_client_side_cookies(struct stream *s, struct channel *req);
-static void htx_manage_server_side_cookies(struct stream *s, struct channel *res);
+static void http_manage_client_side_cookies(struct stream *s, struct channel *req);
+static void http_manage_server_side_cookies(struct stream *s, struct channel *res);
-static int htx_stats_check_uri(struct stream *s, struct http_txn *txn, struct proxy *backend);
-static int htx_handle_stats(struct stream *s, struct channel *req);
+static int http_stats_check_uri(struct stream *s, struct http_txn *txn, struct proxy *backend);
+static int http_handle_stats(struct stream *s, struct channel *req);
-static int htx_handle_expect_hdr(struct stream *s, struct htx *htx, struct http_msg *msg);
-static int htx_reply_100_continue(struct stream *s);
-static int htx_reply_40x_unauthorized(struct stream *s, const char *auth_realm);
+static int http_handle_expect_hdr(struct stream *s, struct htx *htx, struct http_msg *msg);
+static int http_reply_100_continue(struct stream *s);
+static int http_reply_40x_unauthorized(struct stream *s, const char *auth_realm);
/* This stream analyser waits for a complete HTTP request. It returns 1 if the
* processing can continue on next analysers, or zero if it either needs more
@@ -74,7 +74,7 @@
* when it has nothing left to do, and may remove any analyser when it wants to
* abort.
*/
-int htx_wait_for_request(struct stream *s, struct channel *req, int an_bit)
+int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
{
/*
@@ -110,7 +110,7 @@
}
/* we're speaking HTTP here, so let's speak HTTP to the client */
- s->srv_error = htx_return_srv_error;
+ s->srv_error = http_return_srv_error;
/* If there is data available for analysis, log the end of the idle time. */
if (c_data(req) && s->logs.t_idle == -1) {
@@ -161,7 +161,7 @@
txn->status = 400;
msg->err_state = msg->msg_state;
msg->msg_state = HTTP_MSG_ERROR;
- htx_reply_and_close(s, txn->status, NULL);
+ http_reply_and_close(s, txn->status, NULL);
req->analysers &= AN_REQ_FLT_END;
if (!(s->flags & SF_FINST_MASK))
@@ -190,7 +190,7 @@
txn->status = 408;
msg->err_state = msg->msg_state;
msg->msg_state = HTTP_MSG_ERROR;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
req->analysers &= AN_REQ_FLT_END;
if (!(s->flags & SF_FINST_MASK))
@@ -219,7 +219,7 @@
txn->status = 400;
msg->err_state = msg->msg_state;
msg->msg_state = HTTP_MSG_ERROR;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
req->analysers &= AN_REQ_FLT_END;
if (!(s->flags & SF_FINST_MASK))
@@ -271,7 +271,7 @@
s->logs.logwait = 0;
s->logs.level = 0;
s->res.flags &= ~CF_EXPECT_MORE; /* speed up sending a previous response */
- htx_reply_and_close(s, txn->status, NULL);
+ http_reply_and_close(s, txn->status, NULL);
return 0;
}
@@ -291,7 +291,7 @@
(!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) {
int32_t pos;
- htx_debug_stline("clireq", s, sl);
+ http_debug_stline("clireq", s, sl);
for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
struct htx_blk *blk = htx_get_blk(htx, pos);
@@ -302,9 +302,9 @@
if (type != HTX_BLK_HDR)
continue;
- htx_debug_hdr("clihdr", s,
- htx_get_blk_name(htx, blk),
- htx_get_blk_value(htx, blk));
+ http_debug_hdr("clihdr", s,
+ htx_get_blk_name(htx, blk),
+ htx_get_blk_value(htx, blk));
}
}
@@ -353,7 +353,7 @@
if (ret) {
/* we fail this request, let's return 503 service unavail */
txn->status = 503;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_LOCAL; /* we don't want a real error here */
goto return_prx_cond;
@@ -362,7 +362,7 @@
/* nothing to fail, let's reply normally */
txn->status = 200;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_LOCAL; /* we don't want a real error here */
goto return_prx_cond;
@@ -378,7 +378,7 @@
if ((txn->uri = pool_alloc(pool_head_requri)) != NULL) {
size_t len;
- len = htx_fmt_req_line(sl, txn->uri, global.tune.requri_len - 1);
+ len = http_fmt_req_line(sl, txn->uri, global.tune.requri_len - 1);
txn->uri[len] = 0;
if (!(s->logs.logwait &= ~(LW_REQ|LW_INIT)))
@@ -403,7 +403,7 @@
/* 5: we may need to capture headers */
if (unlikely((s->logs.logwait & LW_REQHDR) && s->req_cap))
- htx_capture_headers(htx, s->req_cap, sess->fe->req_cap);
+ http_capture_headers(htx, s->req_cap, sess->fe->req_cap);
/* we may have to wait for the request's body */
if (s->be->options & PR_O_WREQ_BODY)
@@ -439,7 +439,7 @@
txn->status = 400;
txn->req.err_state = txn->req.msg_state;
txn->req.msg_state = HTTP_MSG_ERROR;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
if (sess->listener->counters)
_HA_ATOMIC_ADD(&sess->listener->counters->failed_req, 1);
@@ -463,7 +463,7 @@
* either needs more data or wants to immediately abort the request (eg: deny,
* error, ...).
*/
-int htx_process_req_common(struct stream *s, struct channel *req, int an_bit, struct proxy *px)
+int http_process_req_common(struct stream *s, struct channel *req, int an_bit, struct proxy *px)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -498,7 +498,7 @@
/* evaluate http-request rules */
if (!LIST_ISEMPTY(&px->http_req_rules)) {
- verdict = htx_req_get_intercept_rule(px, &px->http_req_rules, s, &deny_status);
+ verdict = http_req_get_intercept_rule(px, &px->http_req_rules, s, &deny_status);
switch (verdict) {
case HTTP_RULE_RES_YIELD: /* some data miss, call the function later. */
@@ -541,12 +541,12 @@
* by a possible reqrep, while they are processed *after* so that a
* reqdeny can still block them. This clearly needs to change in 1.6!
*/
- if (!s->target && htx_stats_check_uri(s, txn, px)) {
+ if (!s->target && http_stats_check_uri(s, txn, px)) {
s->target = &http_stats_applet.obj_type;
if (unlikely(!si_register_handler(&s->si[1], objt_applet(s->target)))) {
txn->status = 500;
s->logs.tv_request = now;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_RESOURCE;
@@ -554,8 +554,8 @@
}
/* parse the whole stats request and extract the relevant information */
- htx_handle_stats(s, req);
- verdict = htx_req_get_intercept_rule(px, &px->uri_auth->http_req_rules, s, &deny_status);
+ http_handle_stats(s, req);
+ verdict = http_req_get_intercept_rule(px, &px->uri_auth->http_req_rules, s, &deny_status);
/* not all actions implemented: deny, allow, auth */
if (verdict == HTTP_RULE_RES_DENY) /* stats http-request deny */
@@ -567,7 +567,7 @@
/* evaluate the req* rules except reqadd */
if (px->req_exp != NULL) {
- if (htx_apply_filters_to_request(s, req, px) < 0)
+ if (http_apply_filters_to_request(s, req, px) < 0)
goto return_bad_req;
if (txn->flags & TX_CLDENY)
@@ -601,7 +601,7 @@
if (sess->fe == s->be) /* report it if the request was intercepted by the frontend */
_HA_ATOMIC_ADD(&sess->fe->fe_counters.intercepted_req, 1);
- if (htx_handle_expect_hdr(s, htx, msg) == -1)
+ if (http_handle_expect_hdr(s, htx, msg) == -1)
goto return_bad_req;
if (!(s->flags & SF_ERR_MASK)) // this is not really an error but it is
@@ -631,7 +631,7 @@
if (!ret)
continue;
}
- if (!htx_apply_redirect_rule(rule, s, txn))
+ if (!http_apply_redirect_rule(rule, s, txn))
goto return_bad_req;
goto done;
}
@@ -657,7 +657,7 @@
/* Allow cookie logging
*/
if (s->be->cookie_name || sess->fe->capture_name)
- htx_manage_client_side_cookies(s, req);
+ http_manage_client_side_cookies(s, req);
/* When a connection is tarpitted, we use the tarpit timeout,
* which may be the same as the connect timeout if unspecified.
@@ -691,12 +691,12 @@
/* Allow cookie logging
*/
if (s->be->cookie_name || sess->fe->capture_name)
- htx_manage_client_side_cookies(s, req);
+ http_manage_client_side_cookies(s, req);
txn->flags |= TX_CLDENY;
txn->status = http_err_codes[deny_status];
s->logs.tv_request = now;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
stream_inc_http_err_ctr(s);
_HA_ATOMIC_ADD(&sess->fe->fe_counters.denied_req, 1);
if (sess->fe != s->be)
@@ -709,7 +709,7 @@
txn->req.err_state = txn->req.msg_state;
txn->req.msg_state = HTTP_MSG_ERROR;
txn->status = 400;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
if (sess->listener->counters)
@@ -735,7 +735,7 @@
* needs more data, encounters an error, or wants to immediately abort the
* request. It relies on buffers flags, and updates s->req.analysers.
*/
-int htx_process_request(struct stream *s, struct channel *req, int an_bit)
+int http_process_request(struct stream *s, struct channel *req, int an_bit)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -782,7 +782,7 @@
txn->req.msg_state = HTTP_MSG_ERROR;
txn->status = 500;
req->analysers &= AN_REQ_FLT_END;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_RESOURCE;
@@ -816,7 +816,7 @@
* This should only be performed in the backend.
*/
if (s->be->cookie_name || sess->fe->capture_name)
- htx_manage_client_side_cookies(s, req);
+ http_manage_client_side_cookies(s, req);
/* add unique-id if "header-unique-id" is specified */
@@ -972,7 +972,7 @@
txn->req.msg_state = HTTP_MSG_ERROR;
txn->status = 400;
req->analysers &= AN_REQ_FLT_END;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
_HA_ATOMIC_ADD(&sess->fe->fe_counters.failed_req, 1);
if (sess->listener->counters)
@@ -989,7 +989,7 @@
* returns zero, at the beginning because it prevents any other processing
* from occurring, and at the end because it terminates the request.
*/
-int htx_process_tarpit(struct stream *s, struct channel *req, int an_bit)
+int http_process_tarpit(struct stream *s, struct channel *req, int an_bit)
{
struct http_txn *txn = s->txn;
@@ -1012,7 +1012,7 @@
s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
if (!(req->flags & CF_READ_ERROR))
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
req->analysers &= AN_REQ_FLT_END;
req->analyse_exp = TICK_ETERNITY;
@@ -1033,7 +1033,7 @@
* HTTP_MSG_CHK_SIZE, HTTP_MSG_DATA or HTTP_MSG_TRAILERS. It returns zero if it
* needs to read more data, or 1 once it has completed its analysis.
*/
-int htx_wait_for_request_body(struct stream *s, struct channel *req, int an_bit)
+int http_wait_for_request_body(struct stream *s, struct channel *req, int an_bit)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -1065,7 +1065,7 @@
*/
if (msg->msg_state < HTTP_MSG_DATA) {
- if (htx_handle_expect_hdr(s, htx, msg) == -1)
+ if (http_handle_expect_hdr(s, htx, msg) == -1)
goto return_bad_req;
}
@@ -1081,7 +1081,7 @@
missing_data:
if ((req->flags & CF_READ_TIMEOUT) || tick_is_expired(req->analyse_exp, now_ms)) {
txn->status = 408;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_CLITO;
@@ -1115,7 +1115,7 @@
txn->req.err_state = txn->req.msg_state;
txn->req.msg_state = HTTP_MSG_ERROR;
txn->status = 400;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_PRXCOND;
@@ -1140,7 +1140,7 @@
* When in MSG_DATA or MSG_TRAILERS, it will automatically forward chunk_len
* bytes of pending data + the headers if not already done.
*/
-int htx_request_forward_body(struct stream *s, struct channel *req, int an_bit)
+int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -1173,8 +1173,8 @@
return 0;
msg->err_state = msg->msg_state;
msg->msg_state = HTTP_MSG_ERROR;
- htx_end_request(s);
- htx_end_response(s);
+ http_end_request(s);
+ http_end_response(s);
return 1;
}
@@ -1256,9 +1256,9 @@
}
}
- htx_end_request(s);
+ http_end_request(s);
if (!(req->analysers & an_bit)) {
- htx_end_response(s);
+ http_end_response(s);
if (unlikely(msg->msg_state == HTTP_MSG_ERROR)) {
if (req->flags & CF_SHUTW) {
/* request errors are most likely due to the
@@ -1359,10 +1359,10 @@
txn->req.msg_state = HTTP_MSG_ERROR;
if (txn->status > 0) {
/* Note: we don't send any error if some data were already sent */
- htx_reply_and_close(s, txn->status, NULL);
+ http_reply_and_close(s, txn->status, NULL);
} else {
txn->status = status;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
}
req->analysers &= AN_REQ_FLT_END;
s->res.analysers &= AN_RES_FLT_END; /* we're in data phase, we want to abort both directions */
@@ -1421,7 +1421,7 @@
* when it has nothing left to do, and may remove any analyser when it wants to
* abort.
*/
-int htx_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
+int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
{
/*
* We will analyze a complete HTTP response to check the its syntax.
@@ -1511,7 +1511,7 @@
}
s->si[1].flags |= SI_FL_NOLINGER;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_SRVCL;
@@ -1536,7 +1536,7 @@
rep->analysers &= AN_RES_FLT_END;
txn->status = 504;
s->si[1].flags |= SI_FL_NOLINGER;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_SRVTO;
@@ -1554,7 +1554,7 @@
rep->analysers &= AN_RES_FLT_END;
txn->status = 400;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_CLICL;
@@ -1585,7 +1585,7 @@
rep->analysers &= AN_RES_FLT_END;
txn->status = 502;
s->si[1].flags |= SI_FL_NOLINGER;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_SRVCL;
@@ -1630,7 +1630,7 @@
(!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) {
int32_t pos;
- htx_debug_stline("srvrep", s, sl);
+ http_debug_stline("srvrep", s, sl);
for (pos = htx_get_first(htx); pos != -1; pos = htx_get_next(htx, pos)) {
struct htx_blk *blk = htx_get_blk(htx, pos);
@@ -1641,9 +1641,9 @@
if (type != HTX_BLK_HDR)
continue;
- htx_debug_hdr("srvhdr", s,
- htx_get_blk_name(htx, blk),
- htx_get_blk_value(htx, blk));
+ http_debug_hdr("srvhdr", s,
+ htx_get_blk_name(htx, blk),
+ htx_get_blk_value(htx, blk));
}
}
@@ -1738,7 +1738,7 @@
*/
s->logs.logwait &= ~LW_RESP;
if (unlikely((s->logs.logwait & LW_RSPHDR) && s->res_cap))
- htx_capture_headers(htx, s->res_cap, sess->fe->rsp_cap);
+ http_capture_headers(htx, s->res_cap, sess->fe->rsp_cap);
/* Skip parsing if no content length is possible. */
if (unlikely((txn->meth == HTTP_METH_CONNECT && txn->status == 200) ||
@@ -1802,7 +1802,7 @@
return 0;
txn->status = 502;
s->si[1].flags |= SI_FL_NOLINGER;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
rep->analysers &= AN_RES_FLT_END;
if (!(s->flags & SF_ERR_MASK))
@@ -1822,7 +1822,7 @@
s->logs.logwait = 0;
s->logs.level = 0;
s->res.flags &= ~CF_EXPECT_MORE; /* speed up sending a previous response */
- htx_reply_and_close(s, txn->status, NULL);
+ http_reply_and_close(s, txn->status, NULL);
return 0;
}
@@ -1831,7 +1831,7 @@
* and updates s->res.analysers. It might make sense to explode it into several
* other functions. It works like process_request (see indications above).
*/
-int htx_process_res_common(struct stream *s, struct channel *rep, int an_bit, struct proxy *px)
+int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, struct proxy *px)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -1891,7 +1891,7 @@
/* evaluate http-response rules */
if (ret == HTTP_RULE_RES_CONT) {
- ret = htx_res_get_intercept_rule(cur_proxy, &cur_proxy->http_res_rules, s);
+ ret = http_res_get_intercept_rule(cur_proxy, &cur_proxy->http_res_rules, s);
if (ret == HTTP_RULE_RES_BADREQ)
goto return_srv_prx_502;
@@ -1911,7 +1911,7 @@
/* try headers filters */
if (rule_set->rsp_exp != NULL) {
- if (htx_apply_filters_to_response(s, rep, rule_set) < 0)
+ if (http_apply_filters_to_response(s, rep, rule_set) < 0)
goto return_bad_resp;
}
@@ -1969,13 +1969,13 @@
* Now check for a server cookie.
*/
if (s->be->cookie_name || sess->fe->capture_name || (s->be->options & PR_O_CHK_CACHE))
- htx_manage_server_side_cookies(s, rep);
+ http_manage_server_side_cookies(s, rep);
/*
* Check for cache-control or pragma headers if required.
*/
if ((s->be->options & PR_O_CHK_CACHE) || (s->be->ck_opts & PR_CK_NOC))
- htx_check_response_for_cacheability(s, rep);
+ http_check_response_for_cacheability(s, rep);
/*
* Add server cookie in the response if needed
@@ -2115,7 +2115,7 @@
txn->status = 502;
s->logs.t_data = -1; /* was not a valid response */
s->si[1].flags |= SI_FL_NOLINGER;
- htx_reply_and_close(s, txn->status, htx_error_message(s));
+ http_reply_and_close(s, txn->status, http_error_message(s));
if (!(s->flags & SF_ERR_MASK))
s->flags |= SF_ERR_PRXCOND;
if (!(s->flags & SF_FINST_MASK))
@@ -2152,7 +2152,7 @@
* is performed at once on final states for all bytes parsed, or when leaving
* on missing data.
*/
-int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit)
+int http_response_forward_body(struct stream *s, struct channel *res, int an_bit)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -2178,8 +2178,8 @@
*/
msg->err_state = msg->msg_state;
msg->msg_state = HTTP_MSG_ERROR;
- htx_end_response(s);
- htx_end_request(s);
+ http_end_response(s);
+ http_end_request(s);
return 1;
}
@@ -2255,9 +2255,9 @@
}
}
- htx_end_response(s);
+ http_end_response(s);
if (!(res->analysers & an_bit)) {
- htx_end_request(s);
+ http_end_request(s);
if (unlikely(msg->msg_state == HTTP_MSG_ERROR)) {
if (res->flags & CF_SHUTW) {
/* response errors are most likely due to the
@@ -2344,7 +2344,7 @@
txn->rsp.err_state = txn->rsp.msg_state;
txn->rsp.msg_state = HTTP_MSG_ERROR;
/* don't send any error message as we're in the body */
- htx_reply_and_close(s, txn->status, NULL);
+ http_reply_and_close(s, txn->status, NULL);
res->analysers &= AN_RES_FLT_END;
s->req.analysers &= AN_REQ_FLT_END; /* we're in data phase, we want to abort both directions */
if (!(s->flags & SF_FINST_MASK))
@@ -2356,7 +2356,7 @@
* returns zero on success, or zero in case of a, irrecoverable error such
* as too large a request to build a valid response.
*/
-int htx_apply_redirect_rule(struct redirect_rule *rule, struct stream *s, struct http_txn *txn)
+int http_apply_redirect_rule(struct redirect_rule *rule, struct stream *s, struct http_txn *txn)
{
struct channel *req = &s->req;
struct channel *res = &s->res;
@@ -2592,8 +2592,8 @@
return 0;
}
-int htx_transform_header_str(struct stream* s, struct channel *chn, struct htx *htx,
- struct ist name, const char *str, struct my_regex *re, int action)
+int http_transform_header_str(struct stream* s, struct channel *chn, struct htx *htx,
+ struct ist name, const char *str, struct my_regex *re, int action)
{
struct http_hdr_ctx ctx;
struct buffer *output = get_trash_chunk();
@@ -2613,8 +2613,8 @@
return 0;
}
-static int htx_transform_header(struct stream* s, struct channel *chn, struct htx *htx,
- const struct ist name, struct list *fmt, struct my_regex *re, int action)
+static int http_transform_header(struct stream* s, struct channel *chn, struct htx *htx,
+ const struct ist name, struct list *fmt, struct my_regex *re, int action)
{
struct buffer *replace;
int ret = -1;
@@ -2627,7 +2627,7 @@
if (replace->data >= replace->size - 1)
goto leave;
- ret = htx_transform_header_str(s, chn, htx, name, replace->area, re, action);
+ ret = http_transform_header_str(s, chn, htx, name, replace->area, re, action);
leave:
free_trash_chunk(replace);
@@ -2638,7 +2638,7 @@
/* Terminate a 103-Erly-hints response and send it to the client. It returns 0
* on success and -1 on error. The response channel is updated accordingly.
*/
-static int htx_reply_103_early_hints(struct channel *res)
+static int http_reply_103_early_hints(struct channel *res)
{
struct htx *htx = htx_from_buf(&res->buf);
size_t data;
@@ -2663,9 +2663,9 @@
* If <early_hints> is 0, it is starts a new response by adding the start
* line. If an error occurred -1 is returned. On success 0 is returned. The
* channel is not updated here. It must be done calling the function
- * htx_reply_103_early_hints().
+ * http_reply_103_early_hints().
*/
-static int htx_add_early_hint_header(struct stream *s, int early_hints, const struct ist name, struct list *fmt)
+static int http_add_early_hint_header(struct stream *s, int early_hints, const struct ist name, struct list *fmt)
{
struct channel *res = &s->res;
struct htx *htx = htx_from_buf(&res->buf);
@@ -2712,8 +2712,8 @@
* In query string case, the mark question '?' must be set at the start of the
* string by the caller, event if the replacement query string is empty.
*/
-int htx_req_replace_stline(int action, const char *replace, int len,
- struct proxy *px, struct stream *s)
+int http_req_replace_stline(int action, const char *replace, int len,
+ struct proxy *px, struct stream *s)
{
struct htx *htx = htxbuf(&s->req.buf);
@@ -2747,7 +2747,7 @@
/* This function replace the HTTP status code and the associated message. The
* variable <status> contains the new status code. This function never fails.
*/
-void htx_res_set_status(unsigned int status, const char *reason, struct stream *s)
+void http_res_set_status(unsigned int status, const char *reason, struct stream *s)
{
struct htx *htx = htxbuf(&s->res.buf);
char *res;
@@ -2773,8 +2773,8 @@
* and a deny/tarpit rule is matched, it will be filled with this rule's deny
* status.
*/
-static enum rule_result htx_req_get_intercept_rule(struct proxy *px, struct list *rules,
- struct stream *s, int *deny_status)
+static enum rule_result http_req_get_intercept_rule(struct proxy *px, struct list *rules,
+ struct stream *s, int *deny_status)
{
struct session *sess = strm_sess(s);
struct http_txn *txn = s->txn;
@@ -2820,7 +2820,7 @@
resume_execution:
if (early_hints && rule->action != ACT_HTTP_EARLY_HINT) {
early_hints = 0;
- if (htx_reply_103_early_hints(&s->res) == -1) {
+ if (http_reply_103_early_hints(&s->res) == -1) {
rule_ret = HTTP_RULE_RES_BADREQ;
goto end;
}
@@ -2858,14 +2858,14 @@
* increase the counter but brute force attempts will.
*/
rule_ret = HTTP_RULE_RES_ABRT;
- if (htx_reply_40x_unauthorized(s, auth_realm) == -1)
+ if (http_reply_40x_unauthorized(s, auth_realm) == -1)
rule_ret = HTTP_RULE_RES_BADREQ;
stream_inc_http_err_ctr(s);
goto end;
case ACT_HTTP_REDIR:
rule_ret = HTTP_RULE_RES_DONE;
- if (!htx_apply_redirect_rule(rule->arg.redir, s, txn))
+ if (!http_apply_redirect_rule(rule->arg.redir, s, txn))
rule_ret = HTTP_RULE_RES_BADREQ;
goto end;
@@ -2887,10 +2887,10 @@
case ACT_HTTP_REPLACE_HDR:
case ACT_HTTP_REPLACE_VAL:
- if (htx_transform_header(s, &s->req, htx,
- ist2(rule->arg.hdr_add.name, rule->arg.hdr_add.name_len),
- &rule->arg.hdr_add.fmt,
- rule->arg.hdr_add.re, rule->action)) {
+ if (http_transform_header(s, &s->req, htx,
+ ist2(rule->arg.hdr_add.name, rule->arg.hdr_add.name_len),
+ &rule->arg.hdr_add.fmt,
+ rule->arg.hdr_add.re, rule->action)) {
rule_ret = HTTP_RULE_RES_BADREQ;
goto end;
}
@@ -3059,9 +3059,9 @@
case ACT_HTTP_EARLY_HINT:
if (!(txn->req.flags & HTTP_MSGF_VER_11))
break;
- early_hints = htx_add_early_hint_header(s, early_hints,
- ist2(rule->arg.early_hint.name, rule->arg.early_hint.name_len),
- &rule->arg.early_hint.fmt);
+ early_hints = http_add_early_hint_header(s, early_hints,
+ ist2(rule->arg.early_hint.name, rule->arg.early_hint.name_len),
+ &rule->arg.early_hint.fmt);
if (early_hints == -1) {
rule_ret = HTTP_RULE_RES_BADREQ;
goto end;
@@ -3143,7 +3143,7 @@
end:
if (early_hints) {
- if (htx_reply_103_early_hints(&s->res) == -1)
+ if (http_reply_103_early_hints(&s->res) == -1)
rule_ret = HTTP_RULE_RES_BADREQ;
}
@@ -3161,8 +3161,8 @@
* deny rule. If *YIELD is returned, the caller must call again the function
* with the same context.
*/
-static enum rule_result htx_res_get_intercept_rule(struct proxy *px, struct list *rules,
- struct stream *s)
+static enum rule_result http_res_get_intercept_rule(struct proxy *px, struct list *rules,
+ struct stream *s)
{
struct session *sess = strm_sess(s);
struct http_txn *txn = s->txn;
@@ -3232,10 +3232,10 @@
case ACT_HTTP_REPLACE_HDR:
case ACT_HTTP_REPLACE_VAL:
- if (htx_transform_header(s, &s->res, htx,
- ist2(rule->arg.hdr_add.name, rule->arg.hdr_add.name_len),
- &rule->arg.hdr_add.fmt,
- rule->arg.hdr_add.re, rule->action)) {
+ if (http_transform_header(s, &s->res, htx,
+ ist2(rule->arg.hdr_add.name, rule->arg.hdr_add.name_len),
+ &rule->arg.hdr_add.fmt,
+ rule->arg.hdr_add.re, rule->action)) {
rule_ret = HTTP_RULE_RES_BADREQ;
goto end;
}
@@ -3398,7 +3398,7 @@
case ACT_HTTP_REDIR:
rule_ret = HTTP_RULE_RES_DONE;
- if (!htx_apply_redirect_rule(rule->arg.redir, s, txn))
+ if (!http_apply_redirect_rule(rule->arg.redir, s, txn))
rule_ret = HTTP_RULE_RES_BADREQ;
goto end;
@@ -3500,7 +3500,7 @@
* Since it can manage the switch to another backend, it updates the per-proxy
* DENY stats.
*/
-static int htx_apply_filter_to_req_headers(struct stream *s, struct channel *req, struct hdr_exp *exp)
+static int http_apply_filter_to_req_headers(struct stream *s, struct channel *req, struct hdr_exp *exp)
{
struct http_txn *txn = s->txn;
struct htx *htx;
@@ -3596,7 +3596,7 @@
* Since it can manage the switch to another backend, it updates the per-proxy
* DENY stats.
*/
-static int htx_apply_filter_to_req_line(struct stream *s, struct channel *req, struct hdr_exp *exp)
+static int http_apply_filter_to_req_line(struct stream *s, struct channel *req, struct hdr_exp *exp)
{
struct http_txn *txn = s->txn;
struct htx *htx;
@@ -3617,7 +3617,7 @@
done = 0;
- reqline->data = htx_fmt_req_line(http_get_stline(htx), reqline->area, reqline->size);
+ reqline->data = http_fmt_req_line(http_get_stline(htx), reqline->area, reqline->size);
/* Now we have the request line between cur_ptr and cur_end */
if (regex_exec_match2(exp->preg, reqline->area, reqline->data, MAX_MATCH, pmatch, 0)) {
@@ -3663,7 +3663,7 @@
* unparsable request. Since it can manage the switch to another backend, it
* updates the per-proxy DENY stats.
*/
-static int htx_apply_filters_to_request(struct stream *s, struct channel *req, struct proxy *px)
+static int http_apply_filters_to_request(struct stream *s, struct channel *req, struct proxy *px)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -3700,7 +3700,7 @@
}
/* Apply the filter to the request line. */
- ret = htx_apply_filter_to_req_line(s, req, exp);
+ ret = http_apply_filter_to_req_line(s, req, exp);
if (unlikely(ret < 0))
return -1;
@@ -3708,7 +3708,7 @@
/* The filter did not match the request, it can be
* iterated through all headers.
*/
- if (unlikely(htx_apply_filter_to_req_headers(s, req, exp) < 0))
+ if (unlikely(http_apply_filter_to_req_headers(s, req, exp) < 0))
return -1;
}
}
@@ -3718,7 +3718,7 @@
/* Iterate the same filter through all response headers contained in <res>.
* Returns 1 if this filter can be stopped upon return, otherwise 0.
*/
-static int htx_apply_filter_to_resp_headers(struct stream *s, struct channel *res, struct hdr_exp *exp)
+static int http_apply_filter_to_resp_headers(struct stream *s, struct channel *res, struct hdr_exp *exp)
{
struct http_txn *txn = s->txn;
struct htx *htx;
@@ -3809,7 +3809,7 @@
* Returns 0 if nothing has been done, 1 if the filter has been applied,
* or -1 if a replacement resulted in an invalid status line.
*/
-static int htx_apply_filter_to_sts_line(struct stream *s, struct channel *res, struct hdr_exp *exp)
+static int http_apply_filter_to_sts_line(struct stream *s, struct channel *res, struct hdr_exp *exp)
{
struct http_txn *txn = s->txn;
struct htx *htx;
@@ -3828,7 +3828,7 @@
return 0;
done = 0;
- resline->data = htx_fmt_res_line(http_get_stline(htx), resline->area, resline->size);
+ resline->data = http_fmt_res_line(http_get_stline(htx), resline->area, resline->size);
/* Now we have the status line between cur_ptr and cur_end */
if (regex_exec_match2(exp->preg, resline->area, resline->data, MAX_MATCH, pmatch, 0)) {
@@ -3869,7 +3869,7 @@
* Returns 0 if everything is alright, or -1 in case a replacement lead to an
* unparsable response.
*/
-static int htx_apply_filters_to_response(struct stream *s, struct channel *res, struct proxy *px)
+static int http_apply_filters_to_response(struct stream *s, struct channel *res, struct proxy *px)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -3907,7 +3907,7 @@
}
/* Apply the filter to the status line. */
- ret = htx_apply_filter_to_sts_line(s, res, exp);
+ ret = http_apply_filter_to_sts_line(s, res, exp);
if (unlikely(ret < 0))
return -1;
@@ -3915,7 +3915,7 @@
/* The filter did not match the response, it can be
* iterated through all headers.
*/
- if (unlikely(htx_apply_filter_to_resp_headers(s, res, exp) < 0))
+ if (unlikely(http_apply_filter_to_resp_headers(s, res, exp) < 0))
return -1;
}
}
@@ -3928,7 +3928,7 @@
* of the multiple very crappy and ambiguous syntaxes we have to support. it
* highly recommended not to touch this part without a good reason !
*/
-static void htx_manage_client_side_cookies(struct stream *s, struct channel *req)
+static void http_manage_client_side_cookies(struct stream *s, struct channel *req)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -4053,7 +4053,7 @@
*/
preserve_hdr = 1;
if (del_from != NULL) {
- int delta = htx_del_hdr_value(hdr_beg, hdr_end, &del_from, prev);
+ int delta = http_del_hdr_value(hdr_beg, hdr_end, &del_from, prev);
val_end += delta;
next += delta;
hdr_end += delta;
@@ -4283,7 +4283,7 @@
preserve_hdr = 1;
if (del_from != NULL) {
- int delta = htx_del_hdr_value(hdr_beg, hdr_end, &del_from, prev);
+ int delta = http_del_hdr_value(hdr_beg, hdr_end, &del_from, prev);
if (att_beg >= del_from)
att_beg += delta;
if (att_end >= del_from)
@@ -4326,7 +4326,7 @@
* desirable to call it only when needed. This function is also used when we
* just need to know if there is a cookie (eg: for check-cache).
*/
-static void htx_manage_server_side_cookies(struct stream *s, struct channel *res)
+static void http_manage_server_side_cookies(struct stream *s, struct channel *res)
{
struct session *sess = s->sess;
struct http_txn *txn = s->txn;
@@ -4547,7 +4547,7 @@
*/
} else {
/* just remove the value */
- int delta = htx_del_hdr_value(hdr_beg, hdr_end, &prev, next);
+ int delta = http_del_hdr_value(hdr_beg, hdr_end, &prev, next);
next = prev;
hdr_end += delta;
}
@@ -4606,7 +4606,7 @@
* the request may be served from the cache and/or if it is cacheable. Updates
* s->txn->flags.
*/
-void htx_check_request_for_cacheability(struct stream *s, struct channel *req)
+void http_check_request_for_cacheability(struct stream *s, struct channel *req)
{
struct http_txn *txn = s->txn;
struct htx *htx;
@@ -4692,7 +4692,7 @@
/*
* Check if response is cacheable or not. Updates s->txn->flags.
*/
-void htx_check_response_for_cacheability(struct stream *s, struct channel *res)
+void http_check_response_for_cacheability(struct stream *s, struct channel *res)
{
struct http_txn *txn = s->txn;
struct htx *htx;
@@ -4774,7 +4774,7 @@
* scheduled for being forwarded. This is the reason why the number of forwarded
* bytes have to be adjusted.
*/
-int htx_send_name_header(struct stream *s, struct proxy *be, const char *srv_name)
+int http_send_name_header(struct stream *s, struct proxy *be, const char *srv_name)
{
struct htx *htx;
struct http_hdr_ctx ctx;
@@ -4808,7 +4808,7 @@
*
* Returns 1 if stats should be provided, otherwise 0.
*/
-static int htx_stats_check_uri(struct stream *s, struct http_txn *txn, struct proxy *backend)
+static int http_stats_check_uri(struct stream *s, struct http_txn *txn, struct proxy *backend)
{
struct uri_auth *uri_auth = backend->uri_auth;
struct htx *htx;
@@ -4843,7 +4843,7 @@
* s->target which is supposed to already point to the stats applet. The caller
* is expected to have already assigned an appctx to the stream.
*/
-static int htx_handle_stats(struct stream *s, struct channel *req)
+static int http_handle_stats(struct stream *s, struct channel *req)
{
struct stats_admin_rule *stats_admin_rule;
struct stream_interface *si = &s->si[1];
@@ -4992,7 +4992,7 @@
return 1;
}
-void htx_perform_server_redirect(struct stream *s, struct stream_interface *si)
+void http_perform_server_redirect(struct stream *s, struct stream_interface *si)
{
struct channel *req = &s->req;
struct channel *res = &s->res;
@@ -5087,7 +5087,7 @@
/* This function terminates the request because it was completly analyzed or
* because an error was triggered during the body forwarding.
*/
-static void htx_end_request(struct stream *s)
+static void http_end_request(struct stream *s)
{
struct channel *chn = &s->req;
struct http_txn *txn = s->txn;
@@ -5221,7 +5221,7 @@
/* This function terminates the response because it was completly analyzed or
* because an error was triggered during the body forwarding.
*/
-static void htx_end_response(struct stream *s)
+static void http_end_response(struct stream *s)
{
struct channel *chn = &s->res;
struct http_txn *txn = s->txn;
@@ -5326,8 +5326,8 @@
channel_auto_read(chn);
}
-void htx_server_error(struct stream *s, struct stream_interface *si, int err,
- int finst, const struct buffer *msg)
+void http_server_error(struct stream *s, struct stream_interface *si, int err,
+ int finst, const struct buffer *msg)
{
channel_auto_read(si_oc(si));
channel_abort(si_oc(si));
@@ -5355,7 +5355,7 @@
s->flags |= finst;
}
-void htx_reply_and_close(struct stream *s, short status, struct buffer *msg)
+void http_reply_and_close(struct stream *s, short status, struct buffer *msg)
{
channel_auto_read(&s->req);
channel_abort(&s->req);
@@ -5386,7 +5386,7 @@
channel_shutr_now(&s->res);
}
-struct buffer *htx_error_message(struct stream *s)
+struct buffer *http_error_message(struct stream *s)
{
const int msgnum = http_get_status_idx(s->txn->status);
@@ -5409,7 +5409,7 @@
* Note that connection errors appearing on the second request of a keep-alive
* connection are not reported since this allows the client to retry.
*/
-void htx_return_srv_error(struct stream *s, struct stream_interface *si)
+void http_return_srv_error(struct stream *s, struct stream_interface *si)
{
int err_type = si->err_type;
@@ -5417,34 +5417,34 @@
s->txn->status = 503;
if (err_type & SI_ET_QUEUE_ABRT)
- htx_server_error(s, si, SF_ERR_CLICL, SF_FINST_Q,
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_CLICL, SF_FINST_Q,
+ http_error_message(s));
else if (err_type & SI_ET_CONN_ABRT)
- htx_server_error(s, si, SF_ERR_CLICL, SF_FINST_C,
- (s->txn->flags & TX_NOT_FIRST) ? NULL :
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_CLICL, SF_FINST_C,
+ (s->txn->flags & TX_NOT_FIRST) ? NULL :
+ http_error_message(s));
else if (err_type & SI_ET_QUEUE_TO)
- htx_server_error(s, si, SF_ERR_SRVTO, SF_FINST_Q,
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_SRVTO, SF_FINST_Q,
+ http_error_message(s));
else if (err_type & SI_ET_QUEUE_ERR)
- htx_server_error(s, si, SF_ERR_SRVCL, SF_FINST_Q,
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_SRVCL, SF_FINST_Q,
+ http_error_message(s));
else if (err_type & SI_ET_CONN_TO)
- htx_server_error(s, si, SF_ERR_SRVTO, SF_FINST_C,
- (s->txn->flags & TX_NOT_FIRST) ? NULL :
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_SRVTO, SF_FINST_C,
+ (s->txn->flags & TX_NOT_FIRST) ? NULL :
+ http_error_message(s));
else if (err_type & SI_ET_CONN_ERR)
- htx_server_error(s, si, SF_ERR_SRVCL, SF_FINST_C,
- (s->flags & SF_SRV_REUSED) ? NULL :
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_SRVCL, SF_FINST_C,
+ (s->flags & SF_SRV_REUSED) ? NULL :
+ http_error_message(s));
else if (err_type & SI_ET_CONN_RES)
- htx_server_error(s, si, SF_ERR_RESOURCE, SF_FINST_C,
- (s->txn->flags & TX_NOT_FIRST) ? NULL :
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_RESOURCE, SF_FINST_C,
+ (s->txn->flags & TX_NOT_FIRST) ? NULL :
+ http_error_message(s));
else { /* SI_ET_CONN_OTHER and others */
s->txn->status = 500;
- htx_server_error(s, si, SF_ERR_INTERNAL, SF_FINST_C,
- htx_error_message(s));
+ http_server_error(s, si, SF_ERR_INTERNAL, SF_FINST_C,
+ http_error_message(s));
}
}
@@ -5452,7 +5452,7 @@
/* Handle Expect: 100-continue for HTTP/1.1 messages if necessary. It returns 0
* on success and -1 on error.
*/
-static int htx_handle_expect_hdr(struct stream *s, struct htx *htx, struct http_msg *msg)
+static int http_handle_expect_hdr(struct stream *s, struct htx *htx, struct http_msg *msg)
{
/* If we have HTTP/1.1 message with a body and Expect: 100-continue,
* then we must send an HTTP/1.1 100 Continue intermediate response.
@@ -5466,7 +5466,7 @@
/* Expect is allowed in 1.1, look for it */
if (http_find_header(htx, hdr, &ctx, 0) &&
unlikely(isteqi(ctx.value, ist2("100-continue", 12)))) {
- if (htx_reply_100_continue(s) == -1)
+ if (http_reply_100_continue(s) == -1)
return -1;
http_remove_header(htx, &ctx);
}
@@ -5477,7 +5477,7 @@
/* Send a 100-Continue response to the client. It returns 0 on success and -1
* on error. The response channel is updated accordingly.
*/
-static int htx_reply_100_continue(struct stream *s)
+static int http_reply_100_continue(struct stream *s)
{
struct channel *res = &s->res;
struct htx *htx = htx_from_buf(&res->buf);
@@ -5512,7 +5512,7 @@
* ont whether we use a proxy or not. It returns 0 on success and -1 on
* error. The response channel is updated accordingly.
*/
-static int htx_reply_40x_unauthorized(struct stream *s, const char *auth_realm)
+static int http_reply_40x_unauthorized(struct stream *s, const char *auth_realm)
{
struct channel *res = &s->res;
struct htx *htx = htx_from_buf(&res->buf);
@@ -5596,7 +5596,7 @@
* Capture headers from message <htx> according to header list <cap_hdr>, and
* fill the <cap> pointers appropriately.
*/
-static void htx_capture_headers(struct htx *htx, char **cap, struct cap_hdr *cap_hdr)
+static void http_capture_headers(struct htx *htx, char **cap, struct cap_hdr *cap_hdr)
{
struct cap_hdr *h;
int32_t pos;
@@ -5653,7 +5653,7 @@
* - <next> points to a valid delimiter or <end> ;
* - there are non-space chars before <from>.
*/
-static int htx_del_hdr_value(char *start, char *end, char **from, char *next)
+static int http_del_hdr_value(char *start, char *end, char **from, char *next)
{
char *prev = *from;
@@ -5691,7 +5691,7 @@
/* Formats the start line of the request (without CRLF) and puts it in <str> and
* return the written length. The line can be truncated if it exceeds <len>.
*/
-static size_t htx_fmt_req_line(const struct htx_sl *sl, char *str, size_t len)
+static size_t http_fmt_req_line(const struct htx_sl *sl, char *str, size_t len)
{
struct ist dst = ist2(str, 0);
@@ -5715,7 +5715,7 @@
/* Formats the start line of the response (without CRLF) and puts it in <str> and
* return the written length. The line can be truncated if it exceeds <len>.
*/
-static size_t htx_fmt_res_line(const struct htx_sl *sl, char *str, size_t len)
+static size_t http_fmt_res_line(const struct htx_sl *sl, char *str, size_t len)
{
struct ist dst = ist2(str, 0);
@@ -5740,7 +5740,7 @@
/*
* Print a debug line with a start line.
*/
-static void htx_debug_stline(const char *dir, struct stream *s, const struct htx_sl *sl)
+static void http_debug_stline(const char *dir, struct stream *s, const struct htx_sl *sl)
{
struct session *sess = strm_sess(s);
int max;
@@ -5771,7 +5771,7 @@
/*
* Print a debug line with a header.
*/
-static void htx_debug_hdr(const char *dir, struct stream *s, const struct ist n, const struct ist v)
+static void http_debug_hdr(const char *dir, struct stream *s, const struct ist n, const struct ist v)
{
struct session *sess = strm_sess(s);
int max;
@@ -5955,7 +5955,7 @@
DECLARE_POOL(pool_head_uniqueid, "uniqueid", UNIQUEID_LEN);
__attribute__((constructor))
-static void __htx_protocol_init(void)
+static void __http_protocol_init(void)
{
}
diff --git a/src/http_fetch.c b/src/http_fetch.c
index cdf1c0e..08e71f4 100644
--- a/src/http_fetch.c
+++ b/src/http_fetch.c
@@ -38,7 +38,7 @@
#include <proto/http_htx.h>
#include <proto/log.h>
#include <proto/obj_type.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/sample.h>
#include <proto/stream.h>
diff --git a/src/http_rules.c b/src/http_rules.c
index 5089200..b790c5f 100644
--- a/src/http_rules.c
+++ b/src/http_rules.c
@@ -33,7 +33,7 @@
#include <proto/action.h>
#include <proto/arg.h>
#include <proto/http_rules.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/sample.h>
diff --git a/src/payload.c b/src/payload.c
index f9b5fe0..5665794 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -22,7 +22,7 @@
#include <proto/pattern.h>
#include <proto/payload.h>
#include <proto/sample.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
/************************************************************************/
diff --git a/src/proto_http.c b/src/proto_http.c
deleted file mode 100644
index 1b4e0aa..0000000
--- a/src/proto_http.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * HTTP protocol analyzer
- *
- * Copyright 2000-2011 Willy Tarreau <w@1wt.eu>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <time.h>
-
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include <common/base64.h>
-#include <common/cfgparse.h>
-#include <common/chunk.h>
-#include <common/compat.h>
-#include <common/config.h>
-#include <common/debug.h>
-#include <common/h1.h>
-#include <common/memory.h>
-#include <common/mini-clist.h>
-#include <common/standard.h>
-#include <common/ticks.h>
-#include <common/time.h>
-#include <common/uri_auth.h>
-#include <common/version.h>
-
-#include <types/capture.h>
-#include <types/cli.h>
-#include <types/filters.h>
-#include <types/global.h>
-#include <types/stats.h>
-
-#include <proto/acl.h>
-#include <proto/action.h>
-#include <proto/arg.h>
-#include <proto/auth.h>
-#include <proto/backend.h>
-#include <proto/channel.h>
-#include <proto/checks.h>
-#include <proto/cli.h>
-#include <proto/compression.h>
-#include <proto/dns.h>
-#include <proto/stats.h>
-#include <proto/fd.h>
-#include <proto/filters.h>
-#include <proto/frontend.h>
-#include <proto/log.h>
-#include <proto/hlua.h>
-#include <proto/pattern.h>
-#include <proto/proto_tcp.h>
-#include <proto/proto_http.h>
-#include <proto/proxy.h>
-#include <proto/queue.h>
-#include <proto/sample.h>
-#include <proto/server.h>
-#include <proto/session.h>
-#include <proto/stream.h>
-#include <proto/stream_interface.h>
-#include <proto/task.h>
-#include <proto/pattern.h>
-#include <proto/vars.h>
-
-/*
- * Local variables:
- * c-indent-level: 8
- * c-basic-offset: 8
- * End:
- */
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 4ca6fc2..a99febf 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -53,7 +53,7 @@
#include <proto/log.h>
#include <proto/port_range.h>
#include <proto/protocol.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proto_tcp.h>
#include <proto/proxy.h>
#include <proto/sample.h>
diff --git a/src/proxy.c b/src/proxy.c
index 3012233..de54f0b 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -44,7 +44,7 @@
#include <proto/listener.h>
#include <proto/log.h>
#include <proto/proto_tcp.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/server.h>
#include <proto/signal.h>
diff --git a/src/queue.c b/src/queue.c
index f4a9453..1c09482 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -77,7 +77,7 @@
#include <eb32tree.h>
#include <proto/http_rules.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/queue.h>
#include <proto/sample.h>
#include <proto/server.h>
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 3ddacb6..62b85d1 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -77,7 +77,7 @@
#include <proto/listener.h>
#include <proto/pattern.h>
#include <proto/proto_tcp.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/server.h>
#include <proto/stream_interface.h>
#include <proto/log.h>
diff --git a/src/stick_table.c b/src/stick_table.c
index 4b04f18..746cda3 100644
--- a/src/stick_table.c
+++ b/src/stick_table.c
@@ -33,7 +33,7 @@
#include <proto/cli.h>
#include <proto/http_rules.h>
#include <proto/log.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proto_tcp.h>
#include <proto/proxy.h>
#include <proto/sample.h>
diff --git a/src/stream.c b/src/stream.c
index 918da5e..e240551 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -54,7 +54,7 @@
#include <proto/session.h>
#include <proto/stream.h>
#include <proto/pipe.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/proxy.h>
#include <proto/queue.h>
#include <proto/server.h>
@@ -2072,20 +2072,20 @@
/* Warning! ensure that analysers are always placed in ascending order! */
ANALYZE (s, req, flt_start_analyze, ana_list, ana_back, AN_REQ_FLT_START_FE);
FLT_ANALYZE(s, req, tcp_inspect_request, ana_list, ana_back, AN_REQ_INSPECT_FE);
- FLT_ANALYZE(s, req, htx_wait_for_request, ana_list, ana_back, AN_REQ_WAIT_HTTP);
- FLT_ANALYZE(s, req, htx_wait_for_request_body, ana_list, ana_back, AN_REQ_HTTP_BODY);
- FLT_ANALYZE(s, req, htx_process_req_common, ana_list, ana_back, AN_REQ_HTTP_PROCESS_FE, sess->fe);
+ FLT_ANALYZE(s, req, http_wait_for_request, ana_list, ana_back, AN_REQ_WAIT_HTTP);
+ FLT_ANALYZE(s, req, http_wait_for_request_body, ana_list, ana_back, AN_REQ_HTTP_BODY);
+ FLT_ANALYZE(s, req, http_process_req_common, ana_list, ana_back, AN_REQ_HTTP_PROCESS_FE, sess->fe);
FLT_ANALYZE(s, req, process_switching_rules, ana_list, ana_back, AN_REQ_SWITCHING_RULES);
ANALYZE (s, req, flt_start_analyze, ana_list, ana_back, AN_REQ_FLT_START_BE);
FLT_ANALYZE(s, req, tcp_inspect_request, ana_list, ana_back, AN_REQ_INSPECT_BE);
- FLT_ANALYZE(s, req, htx_process_req_common, ana_list, ana_back, AN_REQ_HTTP_PROCESS_BE, s->be);
- FLT_ANALYZE(s, req, htx_process_tarpit, ana_list, ana_back, AN_REQ_HTTP_TARPIT);
+ FLT_ANALYZE(s, req, http_process_req_common, ana_list, ana_back, AN_REQ_HTTP_PROCESS_BE, s->be);
+ FLT_ANALYZE(s, req, http_process_tarpit, ana_list, ana_back, AN_REQ_HTTP_TARPIT);
FLT_ANALYZE(s, req, process_server_rules, ana_list, ana_back, AN_REQ_SRV_RULES);
- FLT_ANALYZE(s, req, htx_process_request, ana_list, ana_back, AN_REQ_HTTP_INNER);
+ FLT_ANALYZE(s, req, http_process_request, ana_list, ana_back, AN_REQ_HTTP_INNER);
FLT_ANALYZE(s, req, tcp_persist_rdp_cookie, ana_list, ana_back, AN_REQ_PRST_RDP_COOKIE);
FLT_ANALYZE(s, req, process_sticking_rules, ana_list, ana_back, AN_REQ_STICKING_RULES);
ANALYZE (s, req, flt_analyze_http_headers, ana_list, ana_back, AN_REQ_FLT_HTTP_HDRS);
- ANALYZE (s, req, htx_request_forward_body, ana_list, ana_back, AN_REQ_HTTP_XFER_BODY);
+ ANALYZE (s, req, http_request_forward_body, ana_list, ana_back, AN_REQ_HTTP_XFER_BODY);
ANALYZE (s, req, pcli_wait_for_request, ana_list, ana_back, AN_REQ_WAIT_CLI);
ANALYZE (s, req, flt_xfer_data, ana_list, ana_back, AN_REQ_FLT_XFER_DATA);
ANALYZE (s, req, flt_end_analyze, ana_list, ana_back, AN_REQ_FLT_END);
@@ -2150,11 +2150,11 @@
ANALYZE (s, res, flt_start_analyze, ana_list, ana_back, AN_RES_FLT_START_FE);
ANALYZE (s, res, flt_start_analyze, ana_list, ana_back, AN_RES_FLT_START_BE);
FLT_ANALYZE(s, res, tcp_inspect_response, ana_list, ana_back, AN_RES_INSPECT);
- FLT_ANALYZE(s, res, htx_wait_for_response, ana_list, ana_back, AN_RES_WAIT_HTTP);
+ FLT_ANALYZE(s, res, http_wait_for_response, ana_list, ana_back, AN_RES_WAIT_HTTP);
FLT_ANALYZE(s, res, process_store_rules, ana_list, ana_back, AN_RES_STORE_RULES);
- FLT_ANALYZE(s, res, htx_process_res_common, ana_list, ana_back, AN_RES_HTTP_PROCESS_BE, s->be);
+ FLT_ANALYZE(s, res, http_process_res_common, ana_list, ana_back, AN_RES_HTTP_PROCESS_BE, s->be);
ANALYZE (s, res, flt_analyze_http_headers, ana_list, ana_back, AN_RES_FLT_HTTP_HDRS);
- ANALYZE (s, res, htx_response_forward_body, ana_list, ana_back, AN_RES_HTTP_XFER_BODY);
+ ANALYZE (s, res, http_response_forward_body, ana_list, ana_back, AN_RES_HTTP_XFER_BODY);
ANALYZE (s, res, pcli_wait_for_response, ana_list, ana_back, AN_RES_WAIT_CLI);
ANALYZE (s, res, flt_xfer_data, ana_list, ana_back, AN_RES_FLT_XFER_DATA);
ANALYZE (s, res, flt_end_analyze, ana_list, ana_back, AN_RES_FLT_END);
@@ -2392,12 +2392,12 @@
(s->be->server_id_hdr_name != NULL) &&
(s->be->mode == PR_MODE_HTTP) &&
objt_server(s->target)) {
- htx_send_name_header(s, s->be, objt_server(s->target)->id);
+ http_send_name_header(s, s->be, objt_server(s->target)->id);
}
srv = objt_server(s->target);
if (si_b->state == SI_ST_ASS && srv && srv->rdr_len && (s->flags & SF_REDIRECTABLE))
- htx_perform_server_redirect(s, si_b);
+ http_perform_server_redirect(s, si_b);
} while (si_b->state == SI_ST_ASS);
}
diff --git a/src/vars.c b/src/vars.c
index 49ff672..b2a2b7e 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -9,7 +9,7 @@
#include <proto/arg.h>
#include <proto/http_rules.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/sample.h>
#include <proto/stream.h>
#include <proto/tcp_rules.h>
diff --git a/src/wurfl.c b/src/wurfl.c
index 7206a1e..1e702c0 100644
--- a/src/wurfl.c
+++ b/src/wurfl.c
@@ -9,7 +9,7 @@
#include <types/global.h>
#include <proto/arg.h>
#include <proto/log.h>
-#include <proto/proto_http.h>
+#include <proto/http_ana.h>
#include <proto/http_fetch.h>
#include <proto/http_htx.h>
#include <proto/sample.h>