From: Jeff Trawick Date: Mon, 5 May 2014 19:26:33 +0000 (+0000) Subject: Follow-up to r1592529: X-Git-Tag: 2.5.0-alpha~4213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65341f92bc68f0f0544a06987daf500d574fa8e5;p=apache Follow-up to r1592529: 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 --- diff --git a/modules/proxy/mod_proxy_scgi.c b/modules/proxy/mod_proxy_scgi.c index 6deae78883..7fb2b873a9 100644 --- a/modules/proxy/mod_proxy_scgi.c +++ b/modules/proxy/mod_proxy_scgi.c @@ -37,13 +37,13 @@ #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) { diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 23f998ead6..5bd9a4b2a4 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -22,6 +22,7 @@ #include "apr_hash.h" #include "proxy_util.h" #include "ajp.h" +#include "scgi.h" #if APR_HAVE_UNISTD_H #include /* 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 index 0000000000..4c997ca7b1 --- /dev/null +++ b/modules/proxy/scgi.h @@ -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 */