summaryrefslogtreecommitdiffstats
path: root/server/listen.c
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2000-07-10 23:37:23 +0200
committerRyan Bloom <rbb@apache.org>2000-07-10 23:37:23 +0200
commitc481bb225a05f9df05ab1f30eeb95dc90a03ccf1 (patch)
tree5c641623667a5b5eccaa9966278ab907bd3774be /server/listen.c
parentMove process_child_status to mpm_common.c. This requires re-naming it (diff)
downloadapache2-c481bb225a05f9df05ab1f30eeb95dc90a03ccf1.tar.xz
apache2-c481bb225a05f9df05ab1f30eeb95dc90a03ccf1.zip
Move setup_listeners to listen.c. This renames it to ap_setup_listeners,
and removes the duplicated code from all effected MPMs. The only this doesn't touch, is Windows. That MPM was using a different setup_listeners. If one of the Windows guys would like to modify the WinNT MPM to use the same setup_lsiteners, that would be VERY cool. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85809 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/listen.c')
-rw-r--r--server/listen.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/server/listen.c b/server/listen.c
index 4eaa9db997..c0715242c2 100644
--- a/server/listen.c
+++ b/server/listen.c
@@ -201,7 +201,9 @@ static void alloc_listener(process_rec *process, char *addr, unsigned int port)
ap_listeners = new;
}
-
+#ifndef WIN32
+static
+#endif
int ap_listen_open(process_rec *process, unsigned port)
{
ap_pool_t *pconf = process->pconf;
@@ -241,6 +243,20 @@ int ap_listen_open(process_rec *process, unsigned port)
return num_open ? 0 : -1;
}
+#ifndef WIN32
+int ap_setup_listeners(server_rec *s)
+{
+ ap_listen_rec *lr;
+ int num_listeners = 0;
+ if (ap_listen_open(s->process, s->port)) {
+ return 0;
+ }
+ for (lr = ap_listeners; lr; lr = lr->next) {
+ num_listeners++;
+ }
+ return num_listeners;
+}
+#endif
void ap_listen_pre_config(void)
{