listen.c revision 28e16aee785efb9f6ebfb30733b823e2a298b50a
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher/* Licensed to the Apache Software Foundation (ASF) under one or more
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * contributor license agreements. See the NOTICE file distributed with
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * this work for additional information regarding copyright ownership.
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * The ASF licenses this file to You under the Apache License, Version 2.0
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * (the "License"); you may not use this file except in compliance with
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * the License. You may obtain a copy of the License at
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * http://www.apache.org/licenses/LICENSE-2.0
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * Unless required by applicable law or agreed to in writing, software
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * distributed under the License is distributed on an "AS IS" BASIS,
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * See the License for the specific language governing permissions and
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher * limitations under the License.
60cab26b12df9a2153823972cde0c38ca86e01b9Yassir ElleyAP_DECLARE_DATA ap_listen_rec *ap_listeners = NULL;
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagher/* TODO: make_sock is just begging and screaming for APR abstraction */
a4cce2c98eedecb5d3b47da62104634cae268434Stephen Gallagherstatic apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server)
#if APR_HAVE_IPV6
#ifdef AP_ENABLE_V4_MAPPED
int v6only_setting = 0;
#ifndef WIN32
apr_socket_close(s);
return stat;
apr_socket_close(s);
return stat;
#if APR_HAVE_IPV6
apr_socket_close(s);
return stat;
if (send_buffer_size) {
if (receive_buffer_size) {
apr_socket_close(s);
return stat;
apr_socket_close(s);
return stat;
#ifdef WIN32
apr_socket_close(s);
return stat;
return APR_SUCCESS;
const char* accf;
&core_module);
if (!proto) {
return NULL;
return NULL;
return accf;
const char *accf;
const char *proto;
if (!proto) {
if (accf) {
accf);
return APR_SUCCESS;
void *dummy)
int found_listener = 0;
if (sa) {
if (found_listener) {
return NULL;
!= APR_SUCCESS) {
addr);
while (sa) {
#if APR_HAVE_IPV6
addr);
return NULL;
int num_open;
void *data;
int use_nonblock;
num_open = 0;
++num_open;
#if APR_HAVE_IPV6
int v6only_setting;
int skip = 0;
if (previous) {
&& v6only_setting == 0) {
if (skip) {
++num_open;
#if APR_HAVE_IPV6
if (previous) {
if (!data) {
int num_listeners = 0;
const char* proto;
int found;
if (!proto) {
found = 0;
if (!found) {
found = 0;
if (!found) {
return num_listeners;
return err;
if (scope_id) {
if (!port) {
void *dummy,
const char *arg)
return err;
ap_listenbacklog = b;
return NULL;
void *dummy,
const char *arg)
return err;
send_buffer_size = s;
return NULL;
void *dummy,
const char *arg)
return err;
receive_buffer_size = s;
return NULL;