|
|
|
@ -641,10 +641,24 @@ static int env_add(char_array *env, const char *key, size_t key_len, const char
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_FORK)
|
|
|
|
|
static int scgi_spawn_connection(server *srv,
|
|
|
|
|
plugin_data *p,
|
|
|
|
|
scgi_extension_host *host,
|
|
|
|
|
scgi_proc *proc) {
|
|
|
|
|
plugin_data *p,
|
|
|
|
|
scgi_extension_host *host,
|
|
|
|
|
scgi_proc *proc) {
|
|
|
|
|
UNUSED(srv);
|
|
|
|
|
UNUSED(p);
|
|
|
|
|
UNUSED(host);
|
|
|
|
|
UNUSED(proc);
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else /* -> defined(HAVE_FORK) */
|
|
|
|
|
|
|
|
|
|
static int scgi_spawn_connection(server *srv,
|
|
|
|
|
plugin_data *p,
|
|
|
|
|
scgi_extension_host *host,
|
|
|
|
|
scgi_proc *proc) {
|
|
|
|
|
int scgi_fd;
|
|
|
|
|
int socket_type, status;
|
|
|
|
|
struct timeval tv = { 0, 100 * 1000 };
|
|
|
|
@ -656,10 +670,6 @@ static int scgi_spawn_connection(server *srv,
|
|
|
|
|
|
|
|
|
|
socklen_t servlen;
|
|
|
|
|
|
|
|
|
|
#ifndef HAVE_FORK
|
|
|
|
|
return -1;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (p->conf.debug) {
|
|
|
|
|
log_error_write(srv, __FILE__, __LINE__, "sdb",
|
|
|
|
|
"new proc, socket:", proc->port, proc->socket);
|
|
|
|
@ -780,7 +790,6 @@ static int scgi_spawn_connection(server *srv,
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_FORK
|
|
|
|
|
switch ((child = fork())) {
|
|
|
|
|
case 0: {
|
|
|
|
|
buffer *b;
|
|
|
|
@ -861,9 +870,11 @@ static int scgi_spawn_connection(server *srv,
|
|
|
|
|
}
|
|
|
|
|
case -1:
|
|
|
|
|
/* error */
|
|
|
|
|
close(scgi_fd);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
/* father */
|
|
|
|
|
close(scgi_fd);
|
|
|
|
|
|
|
|
|
|
/* wait */
|
|
|
|
|
select(0, NULL, NULL, NULL, &tv);
|
|
|
|
@ -902,8 +913,9 @@ static int scgi_spawn_connection(server *srv,
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
} else {
|
|
|
|
|
close(scgi_fd);
|
|
|
|
|
|
|
|
|
|
proc->is_local = 0;
|
|
|
|
|
proc->pid = 0;
|
|
|
|
|
|
|
|
|
@ -917,11 +929,10 @@ static int scgi_spawn_connection(server *srv,
|
|
|
|
|
proc->state = PROC_STATE_RUNNING;
|
|
|
|
|
host->active_procs++;
|
|
|
|
|
|
|
|
|
|
close(scgi_fd);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* HAVE_FORK */
|
|
|
|
|
|
|
|
|
|
SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
|
|
|
|
|
plugin_data *p = p_d;
|
|
|
|
|