[mod_fastcgi,mod_scgi] check for spawning on same unix socket (#319)
error out if duplicated unix socket path and different bin-path is used by lighttpd to start the backend. This is an error. Updates commits97556d99
andb67ff2aa
x-ref: "Should warn if two FastCGI servers point to same socket file" https://redmine.lighttpd.net/issues/319
This commit is contained in:
parent
b67ff2aaca
commit
c1af146a6e
|
@ -1194,7 +1194,8 @@ static fcgi_extension_host * unixsocket_is_dup(plugin_data *p, size_t used, buff
|
|||
for (n = 0; n < ex->used; ++n) {
|
||||
fcgi_extension_host *host = ex->hosts[n];
|
||||
if (!buffer_string_is_empty(host->unixsocket)
|
||||
&& buffer_is_equal(host->unixsocket, unixsocket))
|
||||
&& buffer_is_equal(host->unixsocket, unixsocket)
|
||||
&& !buffer_string_is_empty(host->bin_path))
|
||||
return host;
|
||||
}
|
||||
}
|
||||
|
@ -1392,6 +1393,12 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
|
|||
if (!buffer_string_is_empty(host->bin_path)) {
|
||||
fcgi_extension_host *duplicate = unixsocket_is_dup(p, i+1, host->unixsocket);
|
||||
if (NULL != duplicate) {
|
||||
if (!buffer_is_equal(host->bin_path, duplicate->bin_path)) {
|
||||
log_error_write(srv, __FILE__, __LINE__, "sb",
|
||||
"duplicate unixsocket path:",
|
||||
host->unixsocket);
|
||||
goto error;
|
||||
}
|
||||
fastcgi_host_free(host);
|
||||
host = duplicate;
|
||||
++host->refcount;
|
||||
|
|
|
@ -961,7 +961,8 @@ static scgi_extension_host * unixsocket_is_dup(plugin_data *p, size_t used, buff
|
|||
for (n = 0; n < ex->used; ++n) {
|
||||
scgi_extension_host *host = ex->hosts[n];
|
||||
if (!buffer_string_is_empty(host->unixsocket)
|
||||
&& buffer_is_equal(host->unixsocket, unixsocket))
|
||||
&& buffer_is_equal(host->unixsocket, unixsocket)
|
||||
&& !buffer_string_is_empty(host->bin_path))
|
||||
return host;
|
||||
}
|
||||
}
|
||||
|
@ -1144,6 +1145,12 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
|
|||
if (!buffer_string_is_empty(df->bin_path)) {
|
||||
scgi_extension_host *duplicate = unixsocket_is_dup(p, i+1, df->unixsocket);
|
||||
if (NULL != duplicate) {
|
||||
if (!buffer_is_equal(df->bin_path, duplicate->bin_path)) {
|
||||
log_error_write(srv, __FILE__, __LINE__, "sb",
|
||||
"duplicate unixsocket path:",
|
||||
df->unixsocket);
|
||||
goto error;
|
||||
}
|
||||
scgi_host_free(df);
|
||||
df = duplicate;
|
||||
++df->refcount;
|
||||
|
|
Loading…
Reference in New Issue