]> granicus.if.org Git - apache/commitdiff
Follow-up to r1592529:
authorJeff Trawick <trawick@apache.org>
Mon, 5 May 2014 19:26:33 +0000 (19:26 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 5 May 2014 19:26:33 +0000 (19:26 +0000)
Define default port for "scgi" schemes (as chosen by
mod_proxy_scgi) in a common location.

Suggested by: jailletc36

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

modules/proxy/mod_proxy_scgi.c
modules/proxy/proxy_util.c
modules/proxy/scgi.h [new file with mode: 0644]

index 6deae7888331b99e20d28e9a8b20b60aba8deb09..7fb2b873a9692ef69376e8b6cba0cbc6f20e151c 100644 (file)
 #include "util_script.h"
 
 #include "mod_proxy.h"
+#include "scgi.h"
 
 
 #define SCHEME "scgi"
 #define PROXY_FUNCTION "SCGI"
 #define SCGI_MAGIC "SCGI"
 #define SCGI_PROTOCOL_VERSION "1"
-#define SCGI_DEFAULT_PORT (4000)
 
 /* just protect from typos */
 #define CONTENT_LENGTH "CONTENT_LENGTH"
@@ -183,7 +183,7 @@ static int scgi_canon(request_rec *r, char *url)
     }
     url += sizeof(SCHEME); /* Keep slashes */
 
-    port = def_port = SCGI_DEFAULT_PORT;
+    port = def_port = SCGI_DEF_PORT;
 
     err = ap_proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port);
     if (err) {
index 23f998ead64264996affafee566b924347ea14b1..5bd9a4b2a42e6796b78bd5f0e40703a20c9558e1 100644 (file)
@@ -22,6 +22,7 @@
 #include "apr_hash.h"
 #include "proxy_util.h"
 #include "ajp.h"
+#include "scgi.h"
 
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>         /* for getpid() */
@@ -3514,7 +3515,7 @@ static proxy_schemes_t pschemes[] =
 {
     {"fcgi",     8000},
     {"ajp",      AJP13_DEF_PORT},
-    {"scgi",     4000},
+    {"scgi",     SCGI_DEF_PORT},
     { NULL, 0xFFFF }     /* unknown port */
 };
 
diff --git a/modules/proxy/scgi.h b/modules/proxy/scgi.h
new file mode 100644 (file)
index 0000000..4c997ca
--- /dev/null
@@ -0,0 +1,34 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @file scgi.h
+ * @brief Shared SCGI-related definitions
+ *
+ * @ingroup APACHE_INTERNAL
+ * @{
+ */
+
+#ifndef SCGI_H
+#define SCGI_H
+
+/* This is not defined by the protocol.  It is a convention
+ * of mod_proxy_scgi, and mod_proxy utility routines must
+ * use the same value as mod_proxy_scgi.
+ */
+#define SCGI_DEF_PORT 4000
+
+#endif /* SCGI_H */