[core] shared code for socket backends
commit45b970e69b144c7eaa5508fbb55728cb7c731caf
authorGlenn Strauss <gstrauss@gluelogic.com>
Fri, 14 Jul 2017 05:29:18 +0000 (14 01:29 -0400)
committerGlenn Strauss <gstrauss@gluelogic.com>
Sun, 23 Jul 2017 23:02:00 +0000 (23 19:02 -0400)
treeea5f83a2c4f56910402a2e54fd1a62f721af0fb7
parent81b8fffd311355cb65ab335c760d2e63471eb782
[core] shared code for socket backends

common codebase for socket backends, based off mod_fastcgi with
some features added for mod_proxy

(mostly intended to reduce code duplication and enhance code isolation)

mod_fastcgi and mod_scgi can now use fastcgi.balance and scgi.balance
  for similar behavior as proxy.balance, but the balancing is per-host
  and not per-proc.  proxy.balance is also per-host and not per-proc.

mod_proxy and mod_scgi can now use proxy.map-extensions and
scgi.map-extensions, similar to fastcgi.map-extensions.

mod_fastcgi behavior change (affects only mod_status):
- statistics tags have been renamed from "fastcgi.*" to "gw.*"
  "fastcgi.backend.*"       -> "gw.backend.*"
  "fastcgi.active-requests" -> "gw.active-requests"
  ("fastcgi.requests" remains "fastcgi.requests")
  ("proxy.requests" is new)
  ("scgi.requests" is new)

mod_scgi behavior change (likely minor):
- removed scgi_proclist_sort_down() and scgi_proclist_sort_up().
  procs now chosen based on load as measured by num socket connnections

Note:
modules using gw_backend.[ch] are currently still independent modules.
If it had been written as a single module with fastcgi, scgi, proxy
implementations, then there would have been a chance of breaking some
existing user configurations where module ordering made a difference
for which module handled a given request, though for most people, this
would have made no difference.

Details about mod_fastcgi code transformations:
unsigned int debug -> int debug
fastcgi_env member removed from plugin_config
renamed "fcgi" and "fastcgi" to "gw", and "FCGI" to "GW"
reorganize routines for high-level and lower-level interfaces
some lower-level internal interfaces changed to use host,proc,debug
  args rather than knowing about higher-level (app) hctx and plugin_data
tabs->spaces and reformatting
src/CMakeLists.txt
src/Makefile.am
src/SConscript
src/gw_backend.c [new file with mode: 0644]
src/gw_backend.h [new file with mode: 0644]
src/http-header-glue.c
src/mod_cgi.c
src/mod_fastcgi.c
src/mod_proxy.c
src/mod_scgi.c
src/response.h