Fix build broken w/o --enable-cgid-fdpassing by r1867968: trunk trunk
authorJoe Orton <jorton@apache.org>
Fri, 4 Oct 2019 09:56:42 +0000 (09:56 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 4 Oct 2019 09:56:42 +0000 (09:56 +0000)
* modules/generators/cgi_common.h: Only define CGI bucket type
  if WANT_CGI_BUCKET is defined.

* modules/generators/mod_cgi.c: Always include cgi_common.h, defining
  WANT_CGI_BUCKET iff APR_FILES_AS_SOCKETS is defined

* modules/generators/mod_cgid.c: Always include cgi_common.h, defining
  WANT_CGI_BUCKET iff HAVE_CGID_FDPASSING (--enable-cgid-fdpassing).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867971 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/cgi_common.h
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c

index 0ff66f9..85c9685 100644 (file)
@@ -44,6 +44,7 @@ static void discard_script_output(apr_bucket_brigade *bb)
     }
 }
 
+#ifdef WANT_CGI_BUCKET
 /* A CGI bucket type is needed to catch any output to stderr from the
  * script; see PR 22030. */
 static const apr_bucket_type_t bucket_type_cgi;
@@ -235,6 +236,8 @@ static const apr_bucket_type_t bucket_type_cgi = {
     apr_bucket_copy_notimpl
 };
 
+#endif /* WANT_CGI_BUCKET */
+
 /* Handle the CGI response output, having set up the brigade with the
  * CGI or PIPE bucket as appropriate. */
 static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb,
index 5708aa0..8b96fd5 100644 (file)
@@ -569,8 +569,9 @@ static apr_status_t default_build_command(const char **cmd, const char ***argv,
 }
 
 #if APR_FILES_AS_SOCKETS
-#include "cgi_common.h"
+#define WANT_CGI_BUCKET
 #endif
+#include "cgi_common.h"
 
 static int cgi_handler(request_rec *r)
 {
index 90cd529..102d2b3 100644 (file)
@@ -1349,11 +1349,12 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret,
     return ret;
 }
 
-#ifdef HAVE_CGID_FDPASSING
 /* Pull in CGI bucket implementation. */
 #define cgi_server_conf cgid_server_conf
-#include "cgi_common.h"
+#ifdef HAVE_CGID_FDPASSING
+#define WANT_CGI_BUCKET
 #endif
+#include "cgi_common.h"
 
 static int connect_to_daemon(int *sdptr, request_rec *r,
                              cgid_server_conf *conf)