1
0
mirror of https://github.com/graygnuorg/pound.git synced 2026-10-28 11:35:07 +03:00

84 Commits

Author SHA1 Message Date
Sergey Poznyakoff
926ab7ebba Revamp RewriteLocation support.
* src/config.c (backend_parse_servername): Don't require HTTPS.
ServerName can be used with plain HTTP backends as well.
* src/svc.c (need_rewrite): Rewrite from scratch.
* tests/poundharness.pl (http_redirect): Send original location in
X-Orig-Location header.
* tests/rewriteloc.at: Rewrite.
* tests/rewriteloc_https.at: New test.
* tests/testsuite.at: Include new test.
* tests/Makefile.am: Add new test.
* doc/pound.texi: Document changes.
2024-08-21 12:11:02 +03:00
Sergey Poznyakoff
6847767b7e Rewrite matching support.
Instead of being fixed at compile time, the regex flavour to use can
be selected in configuration file.  Two mechanisms are provided:
the RegexType statement sets the regex type globally, for all statements
that follow it, and special matching options -posix, -pcre (or -perl),
change it for the given statement only.

New matching flag is implemented: -contain.  This flag enables substring
match.

Instead of being translated to regular expressions, the -exact, -beg,
and -end flags are implemented as special matchers.  Translation to
POSIX regex is needed only in case of "Host" statement, which implies
prefixing the pattern with "Host:[[:space:]]*".

* configure.ac (COND_REGEX): Remove variable.
* src/pound.h: Introduce "generic pattern" concept.
(GENPAT): New data type.
(genpat_compile): Rename to genpat_compile.
(genpat_match,genpat_free,genpat_error,genpat_nsub): New protos.
* src/config.c: New global statement: RegexType.
New matching flags: -posix, -pcre, -perl, -contain.
* src/regex_std.c: Remove.
* src/genpat.c: New source.
* src/regex_pcre.c: Rewrite as a genpat module.
* src/regex_pcre2.c: Likewise.
* tests/atlocal.in (PCRE_AVAILABLE): New variable, defined depending on
the value of COND_PCRE and COND_PCRE2 conditionals.
* tests/testsuite.at (PT_PREREQ_PCRE): New macro.
Include pcre.at and regextype.at.
* tests/Makefile.am: Add new files.
* tests/pcre.at: New test.
* tests/regextype.at: New test.
* tests/host.at: Test regexp translation depending on the flags given
(host_prefix_regex function).
* tests/poundharness.pl (preproc): Treat argument to "Host -end" as
"exact".
* tests/url.at: Test the -contain flag.
2024-08-18 14:14:50 +03:00
Carsten Leonhardt
d182cf0e82 Minor change: fix wording of the GDFL license 2024-08-04 15:06:34 +03:00
Sergey Poznyakoff
a89852fa63 Configurable syslog tag
* src/extern.h (syslog_tag): New extern.
* src/pound.c (syslog_tag): New variable.
(main): Use syslog_tag, if set, and progname otherwise.
* src/config.c: New global statement: LogTag.
* NEWS: Document changes.
* doc/pound.8: Likewise.
* doc/pound.texi: Likewise.
* configure.ac: Version 4.12.90
2024-06-26 15:58:32 +03:00
Sergey Poznyakoff
074afeb061 Spell fixes. 2024-06-06 17:11:36 +03:00
Sergey Poznyakoff
988c17c940 Return 405 on forbidden methods. Reword a deprecation hint.
* doc/pound.8: Document changes.
* doc/pound.texi: Likewise.
* src/config.c: Reword the IgnoreCase deprecation message.
* src/http.c (http_status): Define the HTTP_STATUS_METHOD_NOT_ALLOWED
status.
(parse_http_request): Return HTTP_STATUS_METHOD_NOT_ALLOWED if the
method is forbidden by configuration settings.
* src/pound.h (HTTP_STATUS_METHOD_NOT_ALLOWED): New code.
* tests/err501.at: Rename to tests/err503.at. Rewrite test logic.
* tests/errfile.at: Use 405 status instead of 501.
* tests/warndep.at: Update.
* tests/xhttp.at: Expect 405 instead of 501.
2024-04-10 20:24:09 +03:00
Sergey Poznyakoff
aa898eb8ae Minor changes in manpage 2024-04-04 11:15:08 +03:00
Sergey Poznyakoff
5767c72b33 Use designated structure initializers for parser tables. 2024-04-03 23:29:22 +03:00
Sergey Poznyakoff
b56e9586e8 Optionally limit the URI length.
New listener configuration directive MaxURI sets the maximum allowed
length of an URI.

* NEWS: Document changes.
* doc/pound.8: Likewise.
* doc/pound.texi: Likewise.

* src/config.c (http_parsetab, https_parsetab): New statement: MaxURI.
* src/pound.h (max_req): Rename to max_req_size. All uses changed.
New field: max_uri_length.
* src/http.c (do_http): Optionally check if URI length is OK.

* tests/maxuri.at: New testcase.
* tests/Makefile.am: Add new testcase.
* tests/testsuite.at: Add new testcase.
2024-03-30 15:08:28 +02:00
Sergey Poznyakoff
219bdf1210 Issue warning messages if deprecated statements are used in configuration.
* src/extern.h (FEATURE_DEPRECATION): New constant.
* src/config.c (PARSER_TABLE): New fields: deprecation and full_message.
(parse_statement): Warn if a deprecated statement is encountered and
the FEATURE_DEPRECATION feature is set.
Mark all deprecated statements as such.
(feature): Define the FEATURE_DEPRECATION feature.
* NEWS: Document changes.
* doc/pound.8: Likewise.
* doc/pound.texi: Likewise.
2024-03-28 23:44:45 +02:00
Sergey Poznyakoff
975b6f6d6f New statement ErrorFile
This statement obsoletes ErrNNN statements.
* NEWS: Document changes.
* doc/pound.8: Likewise.
* doc/pound.texi: Likewise.
* src/config.c (parse_errorfile): New function.
(http_parsetab, https_parsetab): New keyword: ErrorFile
2024-03-28 17:41:50 +02:00
Sergey Poznyakoff
ecb22c417e Fix improper use of @asis in the docs 2024-03-27 09:02:08 +02:00
Sergey Poznyakoff
ee253dd19a Add makeinfo init file for online docs 2024-02-23 10:42:41 +02:00
Sergey Poznyakoff
6774e8d698 Add texinfo documentation 2024-02-22 17:30:06 +02:00
Sergey Poznyakoff
5257273072 When rewriting a response, apply rules from the service first, then the ones from the listener
* doc/pound.8: Document the changes.
* src/http.c (error_response)
(backend_response): Revert the order in which rewrites are applied.
2024-02-07 16:46:31 +02:00
Sergey Poznyakoff
339d97206a Update copyright dates in manpages 2024-01-04 16:28:34 +02:00
Sergey Poznyakoff
a586ddd05f Update copyright years 2024-01-03 16:43:41 +02:00
Sergey Poznyakoff
2e5e7beef9 New file for declaring conbinable multi-value headers
* src/mvh.inc: New file.
* src/Makefile.am (pkgdata_DATA): Add mvh.inc
* NEWS: Document changes.
* doc/poundctl.8: Minor changes.
2023-11-25 18:19:40 +02:00
Sergey Poznyakoff
959c0e43d4 Argument to Cert statement in ListenHTTPS can be a directory
* NEWS: Document changes.
* doc/pound.8: Document changes.
* src/config.c (openssl_error_at_locus_range): Change signature.
Take filename as arguent.
(conf_openssl_error): Likewise. All uses changed.
(load_cert): New function.
(https_parse_cert): Load all files from the directory.
* src/mem.c (stringbuf_truncate): New function.
* src/pound.h: New prototype.
2023-11-04 12:07:39 +02:00
Sergey Poznyakoff
1be8e4b134 Optionally coalesce multiple-value headers to one value.
* src/ht.h: New file.
* src/pound.h (H_APPEND): New header insertion mode.
(combinable_header_add): New proto.
Use ht.h to generate service hash tables.
Remove long unused CTRL_ definitions.
* src/Makefile.am: Add ht.h
* src/config.c: New statement CombineHeaders.
Use ht.h to generate backend hash tables.
* src/http.c (combinable_header_add, is_combinable_header): New functions.
(cs_locate_token): New function.
(http_header_list_append): Handle H_APPEND.
(http_request_read): For headers from multival_header list, coalesce
multiple headers into a single comma-separated one.
(add_forwarded_headers): Append X-Forwarded-For to the existing header,
if any.
(backend_response): Use cs_locate_token to look for values in multi-value
headers.
(do_http): Likewise. Bail out on multiple Transfer-Encoding headers.

* tests/poundharness.pl (parse_headers): Support multiple headers.
* tests/optorder.at: Fix expectation.
* tests/chunked2.at: New file.
* tests/multival.at: New file.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.
2023-10-23 13:07:05 +03:00
Sergey Poznyakoff
bcb10cbcf1 Implement SNI for HTTPS backends
* src/pound.h (be_regular): New field: servername.
* src/config.c (disable_proto): Fix improper dereferencing of call_data.
(backend_parse_servername): New function.
(backend_parsetab): New statement: ServerName.
* src/http.c (send_to_backend): Rewrite Host: header if servername is
set in the backend.
(open_backend): Set SNI if servername is set.
* doc/pound.8: Document changes.
2023-10-22 22:49:03 +03:00
Sergey Poznyakoff
69f6a2f123 Improve manpage 2023-10-12 17:07:57 +03:00
Sergey Poznyakoff
cd4c97f651 BasicAuth: Cache password file
* configure.ac: Check if struct stat has st_mtim member.
* src/bauth.c (basic_auth_internal): Use cached file content.
Re-read it if file's mtime changed.
* src/pound.h (user_pass): New struct.
(USER_PASS_HEAD): New data type.
(pass_file): New fields: mtim, head.
* NEWS: Document changes.
* doc/pound.8: Likewise.
2023-09-08 22:13:25 +03:00
Sergey Poznyakoff
9e677c2180 Bugfixes
* doc/pound.8: Escape literal backslashes.
* src/poundctl.c (read_response_line): Don't return local variable
address.
2023-09-08 15:03:17 +03:00
Sergey Poznyakoff
4c63800c28 Document recent changes 2023-09-03 14:01:32 +03:00
Sergey Poznyakoff
507b559c85 Fix basicauth in RootJail mode.
* src/bauth.c (basic_auth_internal)
(basic_auth): Get pointer to struct pass_file as argument.
* src/config.c (parse_cond_basic_auth): Initialize
cond->pwfile.
(parse_config_file): If RootJail is requested, open directories
for each struct pass_file used in conditionals.
* src/pound.h (locus_point, locus_range): New struct definitions
(from config.c)
(struct pass_file): New struct.
(SERVICE_COND): Change type of pwfile to struct pass_file.
* src/svc.c (foreach_listener, foreach_service): New functions.
2023-09-03 12:49:59 +03:00
Sergey Poznyakoff
cd2fd19ef3 Global backend definitions
* NEWS: Document changes.
* doc/pound.8: Likewise.
* src/config.c (NAMED_BACKEND, NAMED_BACKEND_TABLE): New types.
(POUND_DEFAULTS): New field: named_backend_table.
(parse_backend_internal): Take start locus as additional argument.
(parse_backend): Support a form with one string label.
(service_parsetab): New statement: UseBackend.
(top_level_parsetab): New statement: Backend.
(parse_config_file): Initialize named_backend_table. Use it on
successful parse termination to resolve references to globally
defined backends and free afterwards.
* src/pound.h (BE_BACKEND_REF): New intermediate backend type.
(BACKEND): New field: v.be_name.
(foreach_backend): New proto.
* src/svc.c (foreach_backend): New function.

* tests/nb.at: New test file.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Include new test.
2023-08-25 14:51:47 +03:00
Sergey Poznyakoff
bb1efb5973 Improve logging configuration
This introduces new service configuration statement SuppressLog, which
suppresses HTTP logging for particular classes of response status codes,
introduces new log format conversion specifier %{OBJ}L, which is expanded
to the location of the object OBJ (listener, service, or backend) in the
configuration file, and replaces specifiers %L, %R, and %S with
${listener}N, ${backend}N, and %{service}N, correspondingly.

* NEWS: Document changes.
* doc/pound.8: Likewise.
* src/config.c (parse_backend_internal)
(parse_redirect_backend,parse_error_backend)
(parse_service,parse_acme,
(parse_listen_http,parse_listen_https)
(parse_control): Initialize locus field.
(canned_log_format): Change format definitions.
(parse_log_suppress): New function.
(service_parsetab): New statement: LogSuppress.
* src/log.c: Support for new specifier.
(http_log): Use log_suppress_mask to decide whether to suppress
log message.
* src/pound.c (main): Check return from listen.
* src/pound.h (BACKEND, SERVICE, LISTENER): New field: locus.
(SERVICE): New field: log_suppress_mask.
(STATUS_MASK): New define.

* tests/logsup.at: New test.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Likewise.
* tests/logfmt.at: Update formats.
2023-08-20 21:45:33 +03:00
Sergey Poznyakoff
ac2d985622 Log format: use %{NAME}N for Pound object name 2023-08-16 19:36:07 +03:00
Sergey Poznyakoff
7b0149200b New log conversion specifier: %L (listener name) 2023-08-16 14:25:36 +03:00
Sergey Poznyakoff
c268ed0c8d Optionally use X-Forwarded-For header to log originating ip.
* NEWS: Document changes.
* doc/pound.8: Document changes.
* src/config.c (service_parsetab)
(http_parsetab,https_parsetab): New statements: ForwardedHeader and
TrustedIP.
* src/extern.h (forwarded_header,trusted_ips): New externs.
* src/http.c (do_http): Stash away the forwarded header before calling
the backend (which may modify it).
* src/log.c (i_forwarded_ip): New function. Try to obtain originator
IP from the forwarded header.
(http_log_spec): Use i_forwarded_ip to handle '%a'.
* src/pound.c (forwarded_header, trusted_ips): New variables.
(pound_http_destroy): Free orig_forwarded_header.
* src/pound.h (SERVICE, LISTENER): New fields: forwarded_header,
trusted_ips.
(POUND_HTTP): New field: orig_forwarded_header.
2023-08-10 12:50:06 +03:00
Sergey Poznyakoff
37b61bfb7a Document new features 2023-08-09 17:00:56 +03:00
Sergey Poznyakoff
7e5e5e75e3 Spell checking 2023-08-07 20:13:23 +03:00
Sergey Poznyakoff
9292e783de Implement StringMatch matcher, host and port accessors.
* NEWS: Document changes.
* configure.ac: Version 4.8.90.
* doc/pound.8: Likewise.
* src/config.c (build_regex): Fix the exact matching,
* src/http.c (parse_cond_matcher): Implement COND_STRING_MATCH.
(MATCH_CONDITIONS): Add StringMatch.
(accessors): change signatures.
(accessor_host, accessor_port): New accessors.
(rewrite_apply): Change signature: take struct submatch_queue pointer
as last argument. All uses changed.
(match_cond): Implement COND_STRING_MATCH.
* src/pound.h (query_param_match): Remove struct definition.
(STRING_REF, struct string_match): New types.
(SERVICE_COND): Replace struct query_param_match with string_match.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Include new tests.
2023-08-07 20:05:28 +03:00
Sergey Poznyakoff
11e05debe9 Spelling fixes 2023-04-19 07:03:01 +03:00
Sergey Poznyakoff
ffaf1b33a9 Revise the docs 2023-04-17 18:54:19 +03:00
Sergey Poznyakoff
1a348505e0 Block form of the Control statement.
The Control statement in block form allows the user to specify socket
file mode and change its ownership.

* NEWS: Document changes.
* doc/pound.8: Document changes.
* src/config.c (push_input): Fix diagnostic message.
(listener_alloc): Initialize mode.
(parse_control_socket,parse_control): New functions.  Support
inline and block forms of the Control statement.
* src/pound.c (main): Optionally set socket mode and ownership.
* src/pound.h (LISTENER): New fields: mode and chowner.
2023-04-05 12:24:50 +03:00
Sergey Poznyakoff
819d76a774 More RootJail related changes
Content of files supplied with Error statements is read at startup.
PID file and control socket are properly removed on exit even
after chroot.

* NEWS: Document changes.
* README.md: Likewise.
* doc/pound.8: Likewise.
* src/config.c (parse_error_backend): Read the file here and store
its content in error.text.
(parse_control_global): Use unlink_at_exit.
* src/http.c (error_response): Send error.text instead of opening
the file and reading it.
* src/pound.c (unlink_at_exit): New function.  Arrange for the file to
be removed even in jail mode.
(pidfile_create): Use unlink_at_exit.
* src/pound.h (be_error): Replace file (file name) with text (file
content).
(unlink_file): Remove proto.
(unlink_at_exit): New proto.
* src/svc.c (str_be, backend_serialize): Reflect the changes.
2023-03-29 22:35:27 +03:00
Sergey Poznyakoff
dece809bf3 Update the manpage. 2023-03-28 19:20:46 +03:00
Sergey Poznyakoff
6c7258cb2e Include directive is allowed anyplace
* NEWS: Document changes.
* doc/pound.8: Likewise.
* src/config.c (parse_statement, parse_acl): Allow for an "Include".

* tests/Makefile.am: Add new test.
* tests/testsuite.at: Include new test.
* tests/inclscope.at: New test.
2023-03-18 19:46:23 +02:00
Sergey Poznyakoff
ca35b251ce Support for -file option to request matching directives.
The -file option instructs the directive to treat its argument as
the name of a file to read patterns from.

* NEWS: Document changes.
* doc/pound.8: Likewise.
* src/config.c (open_include_dir, close_include_dir)
(fopen_include): New functions.
(input_open): Use fopen_include.
(push_input): Use fstatat.
(parse_match_mode): Support the -file option.
(parse_cond_matcher): Rewrite taking into account eventual -file option
and other subtleties.  All uses changed.
(top_level_parsetab): New statement: IncludeDir.
(feature): New feature: include-dir.
(pound_settings): Add include directory.
(config_parse): Use SYSCONFDIR as include directory by default.
* src/extern.h (FEATURE_INCLUDE_DIR): New feature.
* tests/fromfile.at: New test.
* tests/include.at: New test.
* tests/incldir.at: New test.
* tests/inclnest.at: New test.
* tests/Makefile.am: Add new files.
* tests/testsuite.at: Include new tests.
(PT_CONF): Pass the -W[no-]include-dir option to pound.
* tests/poundharness.pl: New options: --preproc and --include-dir.
(runner): Pass the -W[no-]include-dir option to pound.
2023-03-13 15:36:09 +02:00
Sergey Poznyakoff
6b49a31b18 Version 4.6 2023-03-07 22:09:54 +02:00
Sergey Poznyakoff
56c8956409 Check the use of backends in services for correctness
* NEWS: Document changes.
* doc/pound.8: Document changes.
* src/config.c (parse_service): Bail out if multiple special backends
are used.  Emit a warning if multiple Redirect backends are used or if
one or more redirects is mixed with regular backends.

* tests/bemix.at: New test.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Include new test.
* tests/balancing.at: Fix typo.
2023-03-07 11:21:23 +02:00
Sergey Poznyakoff
cfee6266ac Implement interleaved weighted round robin balancing strategy
* src/config.c (POUND_DEFAULTS): New field: balancer.
(parse_service): Initialize balancer.
(service_parsetab,top_level_parsetab): New keyword: Balancer.
* src/pound.h (BALANCER): New type.
(SERVICE): New fields: max_pri, balancer, iwrr_round,
iwrr_cur.
(service_balancer_init): New proto.
* src/svc.c (service_lb_init)
(service_lb_select_backend): New functions.
Use service_lb_select_backend instead of rand_backend everywhere.
* tests/balancing.at: Use IWRR during testing.
* tests/prio.at: Likewise.
* tests/poundharness.pl: Used with stats request, index=N parameter
requests the percentage of requests handleb by Nth backend.

* NEWS: Document new features.
* doc/pound.8: Likewise.
2023-03-06 20:45:43 +02:00
Sergey Poznyakoff
8f0228551b Identify listeners and services by their names (labels) as well as indices
* src/config.c (parse_listen_http)
(parse_listen_https): Handle optional listener name.  Make sure it
is unique.
(parse_service): Make sure service name is unique.
* src/pound.h (LISTENER): New field: name.
* src/poundctl.tmpl: Show listener name, if available.
* svc.c (get_nth_listener, get_nth_service)
(get_nth_backend,ctl_getnum): Remove.
(IDENT): New data type.
(ctl_getident,locate_listener,locate_service)
(locate_backend): New functions.
(service_serialize): Represent NULL service name as null.
(listener_serialize): Add listener name.
(ctl_service,ctl_listener): Identify objects by their ids or numbers.

* NEWS: Document changes.
* doc/pound.8: Likewise.
* doc/poundctl.8: Likewise.
2023-03-03 12:14:33 +02:00
Sergey Poznyakoff
6a87e134c5 Don't decode request parts. Return 500 on string expansion errors.
Mandatory percent decoding creates more problems than it solves. It
can perhaps be used optionally in request matching, but that is left
for further consideration.

* doc/pound.8: Document changes.
* src/http.c: Don't urldecode request parts.
(expand_string_to_buffer): Return -1 if invalid barckreferences or
accessors are encountered.
Don't bail out on percent-encodings.
(expand_string): Handle error return from expand_string_to_buffer.
* src/pound.h (http_request): Remove storage for decoded values.

* tests/poundharness.pl (getline): Handle undefined return gratiously.
(ParseRequest): Terminate thread on EOF.

* tests/backref.at: Update expected values.
* tests/experr.at: Likewise.
* tests/lstset.at: Likewise.
* tests/redirect.at: Likewise.
* tests/reqacc.at: Likewise.
* tests/set.at: Likewise.
2023-02-19 17:29:22 +02:00
Sergey Poznyakoff
9b36acff63 Fix percent encoding/decoding of the path part.
Remove fragment handling: let's not meddle in the affairs of clients.

* NEWS: Reflect changes.
* doc/pound.8: Likewise.
* src/pound.h (http_request): Remove frag_raw and frag.
New field path_raw.
* src/http.c (expand_string_to_buffer): Don't allow subject
indexes after compatibility references (%N).
(urlencode): Take additional argument indicating whether the
string being encoded is a path.
(http_request_rebuild_url): Use path_raw.
(http_request_get_path): Decode path if necessary.
(http_request_free): Free path_raw.
* src/config.c: Remove fragment directives.
* tests/backref.at: Expect encoded URI.
* tests/experr.at: Likewise.
* tests/lstset.at: Remove fragment tests.
* tests/reqacc.at: Likewise.
* tests/set.at: Likewise.
2023-02-18 18:15:43 +02:00
Sergey Poznyakoff
3cd8178c85 Improve request matching and implement request modification directives.
Implement request accessors. Test rewrite rules.

Keep a cyclic queue of submatches

Up to 8 recent matches can be referenced in arguments to request
modification directives.  The notation $N refers to the Nth sub-
expression of the most recent match.  The notation $N(M) refers
to the Nth subexpression of the Mth recent match (match indexes
are 0-based).  For compatibility with versions 4.4-4.5, %N is
taken to mean $N(1).

* src/http.c: Rewrite http_request support.
(match_cond): Move from svc.c. Add support for new condition types.
(rewrite_apply): New function.
(send_to_backend): Call rewrite_apply.
(expand_string_to_buffer,expand_string): New function.
(expand_url): Rewrite using expand_string_to_buffer.
(urldecode,urlencode): New functions.
(submatch_reset,submatch_queue_init)
(submatch_queue_get,submatch_queue_push)
(submatch_queue_free): New functions.
(expand_string_to_buffer): Rewrite using submatch_queue.  All
uses changed.
Implement request accessors.
Fix dead loop occurring when invalid percent sequence is encountered.
(match_cond): Change signature. Use submatch_queue_push to
get new submatch slot each time it is needed.
(rewrite_rule_check, rewrite_op_apply): Change signature. All uses
changed.
(expand_string_to_buffer): Support ${N} notation
along with $N. Count accessor expansions in the return value.
(send_to_backend): Apply listener's rewrite rules.
(http_request_rebuild): Replace with three functions, invoked when
needed: http_request_rebuild_line, http_request_rebuild_url, and
http_request_rebuild_query.
(http_header_list_filter): Bugfix: revert condition.
* src/pound.c (pound_http_enqueue): Add explanatory comment.
(pound_http_destroy): Call submatch_queue_free.
* src/pound.h (query_param,QUERY_HEAD): New aggregate types.
(http_request): New fields: path, query_raw, query, frag_raw,
frag, orig_request_line, flags.
(be_redirect): Rename append_uri to has_uri, to avoid confusion.
(COND_PATH,COND_QUERY,COND_QUERY_PARAM,COND_FRAG): New cond types.
(query_param_match): New aggregate type.
(SERVICE_COND): New union member: qp.
(REWRITE_OP,REWRITE_OP_HEAD)
(REWRITE_RULE_HEAD,REWRITE_RULE): New aggregate types.
(SERVICE): New field: rewrite.
(struct submatch): Subject is allocated, so remove the const
qualifier.
(get_service): Simplify signature.
(match_cond): New proto.
(SMQ_SIZE): New constant.
(submatch_queue): New struct.
(submatch_free): Remove proto.
(submatch_queue_free): New proto.
(POUND_HTTP): Remove field sm.
New field smq.
(get_service): Change signature.
(LISTENER): Remove head_off and add_header. New field: rewrite.
(http_request): Replace "flags" field with "split".
HRF_* constants removed as well.
* src/svc.c (match_service,get_service): Change signature.
* src/config.c (input): Remove field: ready. New fields: putback
and putback_index.
(input_gettkn, input_putback): Rewrite putback handling.
New block statement: Rewrite ... [Else ...] End
New statements: Path, Query, QueryParam, Fragment,
SetHeader, DeleteHeader, SetURL, SetPath, SetQuery,
SetQueryParam, SetFragment.
Remove "AND" and "OR" block statements (these were undocumented
 shortcuts for "Match AND" and "Match OR").
(parse_header_remove): New function. Handles
HeaderRemove (HeadRemove) keywords.
HeaderAdd, and AddHeader are handled as synonims of SetHeader.
LISTENERs rewrite field.
Fix formation of regular expression for matchers.
Allow for "set" statements without enclosing Rewrite block.

* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.
* tests/chgvis.at: New file.
* tests/reqacc.at: New file.
* tests/rwchain.at: New file.
* tests/set.at: New file.
* tests/headrem.at: Rewrite test to catch eventual bugs in
http_header_list_filter.

* NEWS: Document changes.
* doc/pound.8: Likewise.
2023-02-17 21:27:44 +02:00
Sergey Poznyakoff
3f5e1b543f Version 4.5 2023-02-12 10:56:35 +02:00
Sergey Poznyakoff
c79893ae37 Implement metrics backend
This backend type implements openmetrics telemetry endpoint.
2023-02-10 19:23:36 +02:00