]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mod_cgid: Continuation of r1862968, experimental fd passing support.
authorJoe Orton <jorton@apache.org>
Wed, 17 Jul 2019 07:51:53 +0000 (07:51 +0000)
committerJoe Orton <jorton@apache.org>
Wed, 17 Jul 2019 07:51:53 +0000 (07:51 +0000)
commiteda8ddfc718ec893d842a867e6ad6c0f05fa7557
tree13d4c528b69ddc20fb046b4f374eda32aeea5125
parentda33fd570880c4cc90465b96936b2bb40af4b632
mod_cgid: Continuation of r1862968, experimental fd passing support.

Split out CGI bucket implementation from mod_cgi and use in both
mod_cgi and mod_cgid, bringing stderr handling in mod_cgid up to par
with mod_cgi.  (There is a lot of code which has been copied between
mod_cgi{,d} so there's scope for further reduction of source
duplication between the modules using this header)

* modules/generators/cgi_common.h: Copied from mod_cgi.c, removed
  everything but the CGI bucket implementation with only one change:
  (struct cgi_bucket_data, cgi_bucket_create, cgi_bucket_read): Take a
  timeout on bucket creation, store and use on reads.

* modules/generators/mod_cgi.c [APR_FILES_AS_SOCKETS]: Include
  cgi_common.h.
  (cgi_handler): Pass configured timeout to CGI bucket.

* modules/generators/mod_cgid.c: Include cgi_common.h.
  (log_script_err): Copy from mod_cgi.c.
  (log_script): Use log_script_err.
  (send_req): Take fd for stderr.
  (cgid_child_errfn): Handle fd-passing case by writing error
  to stderr for client to pass through ap_log_rerror.
  (cgid_handler): Create pipe for stderr, pass write-end to
  server via send_req, use read-end to create CGI bucket.  Handle
  stderr output in failure paths.

PR: 54221

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1863191 13f79535-47bb-0310-9956-ffa450edef68
docs/log-message-tags/next-number
modules/generators/cgi_common.h [new file with mode: 0644]
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c