functions. This allows APR programs to specify that a socket should
be passed to any child processes that are created. The inherit flag
is only meaningful if programs use apr_process_create(). This
also adds a couple of macros that allow APR types to set and unset
the inherit flag.
This also fixes Apache to use the new API.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89557
13f79535-47bb-0310-9956-
ffa450edef68
if (default_family == APR_UNSPEC) {
apr_socket_t *tmp_sock;
- if (apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM,
+ if (apr_socket_create(&tmp_sock, APR_INET6, SOCK_STREAM, APR_INHERIT,
p) == APR_SUCCESS) {
apr_socket_close(tmp_sock);
default_family = APR_INET6;
return;
}
if ((status = apr_socket_create(&new->sd, new->bind_addr->sa.sin.sin_family,
- SOCK_STREAM, process->pool)) != APR_SUCCESS) {
+ SOCK_STREAM, APR_INHERIT, process->pool)) != APR_SUCCESS) {
ap_log_perror(APLOG_MARK, APLOG_CRIT, status, process->pool,
"alloc_listener: failed to get a socket for %s", addr);
return;
}
apr_sockaddr_info_get(&sa, "127.0.0.1", APR_UNSPEC, ap_listeners->bind_addr->port, 0, pod->p);
- rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, pod->p);
+ rv = apr_socket_create(&sock, sa->family, SOCK_STREAM, APR_NO_INHERIT, pod->p);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf,
"get socket to connect to listener");
#include "apr_network_io.h"
#include "apr_strings.h"
#include "apr_lib.h"
+#include "apr_inherit.h"
#define APR_WANT_STDIO
#define APR_WANT_STRFUNC
if ((rv = apr_socket_create(newsock,
localsa->sa.sin.sin_family, /* has to match */
- SOCK_STREAM, conn->pool)) != APR_SUCCESS) {
+ SOCK_STREAM, APR_NO_INHERIT, conn->pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, srv,
"rfc1413: error creating query socket");
return rv;
apr_err(buf, rv);
}
if ((rv = apr_socket_create(&c->aprsock, destsa->sa.sin.sin_family,
- SOCK_STREAM, cntxt)) != APR_SUCCESS) {
+ SOCK_STREAM, APR_NO_INHERIT, cntxt)) != APR_SUCCESS) {
apr_err("socket", rv);
}
c->start = apr_time_now();
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.72 $> apache-2.0");
+ printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.73 $> apache-2.0");
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Copyright (c) 1998-2001 The Apache Software Foundation, http://www.apache.org/\n");
printf("\n");
}
else {
printf("<p>\n");
- printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.72 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.73 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Copyright (c) 1998-2001 The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");