This extends the functionality added in 3758b19774, by allowing to
select the service to send the request to.
* src/http.c (capture_start, capture_end): Base logic on the
value phttp->capturing.
(backend_response): Close backend if the conn_closed flag is set.
(regular_response): Rework logic to move resending loop to the
caller.
(http_process_request): Move resending loop here.
* src/pndlua.c: New http field: service.
Fields available for reading: service.index, service.name, service.locus.
Fields available for writing: service.index, service.name. Setting these
selects another service (if non-nil), or resets it so that pound runs the
regular service selection logic afterwards.
* src/pound.h (resend_mode, capture_state): New data types.
(POUND_HTTP): Change type of the capturing field.
[ENABLE_LUA]: Change type of the resend field. New fields: resend_svc,
resend_count.
(phttp_lua_stash_reset): Reset new fields.
(phttp_resend_service,phttp_resend_next): New functions.
* tests/lua-resend-loop.at: New test.
* tests/lua-resend-same.at: New test.
* test/lua-resend-service.at: New test.
* test/lua-resend-nulsvc.at: New test.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.
* tests/poundharness.pl: New backend etrypoint: /bauth (basic auth).