csd = ap_get_module_config(c->conn_config, &core_module);
csd_set = 1;
}
- apr_setsocketopt(csd, APR_INCOMPLETE_READ, 1);
+ apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
}
return OK;
#if !defined(TPF) && !defined(BEOS)
if (conf->recv_buffer_size > 0
- && (rv = apr_setsocketopt(sock, APR_SO_RCVBUF,
- conf->recv_buffer_size))) {
+ && (rv = apr_socket_opt_set(sock, APR_SO_RCVBUF,
+ conf->recv_buffer_size))) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
+ "apr_socket_opt_set(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
}
#endif
- if (APR_SUCCESS != (rv = apr_setsocketopt(sock, APR_SO_REUSEADDR, one))) {
+ if ((rv = apr_socket_opt_set(sock, APR_SO_REUSEADDR, one))
+ != APR_SUCCESS) {
#ifndef _OSD_POSIX /* BS2000 has this option "always on" */
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "proxy: FTP: error setting reuseaddr option: setsockopt(SO_REUSEADDR)");
+ "proxy: FTP: error setting reuseaddr option: apr_socket_opt_set(SO_REUSEADDR)");
return HTTP_INTERNAL_SERVER_ERROR;
#endif /* _OSD_POSIX */
}
}
#if !defined (TPF) && !defined(BEOS)
- if (conf->recv_buffer_size > 0 && (rv = apr_setsocketopt(data_sock, APR_SO_RCVBUF,
- conf->recv_buffer_size))) {
+ if (conf->recv_buffer_size > 0
+ && (rv = apr_socket_opt_set(data_sock, APR_SO_RCVBUF,
+ conf->recv_buffer_size))) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "proxy: FTP: setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
+ "proxy: FTP: apr_socket_opt_set(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
}
#endif
}
#if !defined (TPF) && !defined(BEOS)
- if (conf->recv_buffer_size > 0 && (rv = apr_setsocketopt(data_sock, APR_SO_RCVBUF,
- conf->recv_buffer_size))) {
+ if (conf->recv_buffer_size > 0
+ && (rv = apr_socket_opt_set(data_sock, APR_SO_RCVBUF,
+ conf->recv_buffer_size))) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
- "proxy: FTP: setsockopt(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
+ "proxy: FTP: apr_socket_opt_set(SO_RCVBUF): Failed to set ProxyReceiveBufferSize, using default");
}
#endif
apr_sockaddr_port_get(&local_port, local_addr);
apr_sockaddr_ip_get(&local_ip, local_addr);
- if ((rv = apr_setsocketopt(local_sock, APR_SO_REUSEADDR, one)) != APR_SUCCESS) {
+ if ((rv = apr_socket_opt_set(local_sock, APR_SO_REUSEADDR, one))
+ != APR_SUCCESS) {
#ifndef _OSD_POSIX /* BS2000 has this option "always on" */
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"proxy: FTP: error setting reuseaddr option");
#if !defined(TPF) && !defined(BEOS)
if (conf->recv_buffer_size > 0 &&
- (rv = apr_setsocketopt(*newsock, APR_SO_RCVBUF,
- conf->recv_buffer_size))) {
+ (rv = apr_socket_opt_set(*newsock, APR_SO_RCVBUF,
+ conf->recv_buffer_size))) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
- "setsockopt(SO_RCVBUF): Failed to set "
+ "apr_socket_opt_set(SO_RCVBUF): Failed to set "
"ProxyReceiveBufferSize, using default");
}
#endif
*/
timeout = apr_time_from_sec(SECONDS_TO_LINGER);
apr_socket_timeout_set(csd, timeout);
- apr_setsocketopt(csd, APR_INCOMPLETE_READ, 1);
+ apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
while (1) {
nbytes = sizeof(dummybuf);
rc = apr_recv(csd, dummybuf, &nbytes);
apr_status_t stat;
#ifndef WIN32
- stat = apr_setsocketopt(s, APR_SO_REUSEADDR, one);
+ stat = apr_socket_opt_set(s, APR_SO_REUSEADDR, one);
if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p,
- "make_sock: for address %pI, setsockopt: (SO_REUSEADDR)",
+ "make_sock: for address %pI, apr_socket_opt_set: (SO_REUSEADDR)",
server->bind_addr);
apr_socket_close(s);
return stat;
}
#endif
- stat = apr_setsocketopt(s, APR_SO_KEEPALIVE, one);
+ stat = apr_socket_opt_set(s, APR_SO_KEEPALIVE, one);
if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p,
- "make_sock: for address %pI, setsockopt: (SO_KEEPALIVE)",
+ "make_sock: for address %pI, apr_socket_opt_set: (SO_KEEPALIVE)",
server->bind_addr);
apr_socket_close(s);
return stat;
* If no size is specified, use the kernel default.
*/
if (send_buffer_size) {
- stat = apr_setsocketopt(s, APR_SO_SNDBUF, send_buffer_size);
+ stat = apr_socket_opt_set(s, APR_SO_SNDBUF, send_buffer_size);
if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
ap_log_perror(APLOG_MARK, APLOG_WARNING, stat, p,
"make_sock: failed to set SendBufferSize for "
* So set reuseaddr, but do not attempt to do so until we have the
* parent listeners successfully bound.
*/
- stat = apr_setsocketopt(s, APR_SO_REUSEADDR, one);
+ stat = apr_socket_opt_set(s, APR_SO_REUSEADDR, one);
if (stat != APR_SUCCESS && stat != APR_ENOTIMPL) {
ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p,
- "make_sock: for address %pI, setsockopt: (SO_REUSEADDR)",
+ "make_sock: for address %pI, apr_socket_opt_set: (SO_REUSEADDR)",
server->bind_addr);
apr_socket_close(s);
return stat;
#if APR_O_NONBLOCK_INHERITED
for(lr = ap_listeners ; lr != NULL ; lr = lr->next) {
- apr_setsocketopt(lr->sd, APR_SO_NONBLOCK, 1);
+ apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, 1);
}
#endif /* APR_O_NONBLOCK_INHERITED */
/* If we got a new socket, set it to non-blocking mode and process
it. Otherwise handle the error. */
if (stat == APR_SUCCESS) {
- apr_setsocketopt(csd, APR_SO_NONBLOCK, 0);
+ apr_socket_opt_set(csd, APR_SO_NONBLOCK, 0);
#ifdef DBINFO_ON
if (wouldblock_retry < MAX_WB_RETRIES) {
retry_success++;
}
/* Use non-blocking listen sockets so that we
never get hung up. */
- apr_setsocketopt(lr->sd, APR_SO_NONBLOCK, 1);
+ apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, 1);
}
return 0;
}
if (c) {
ap_process_connection(c, context->sock);
- apr_getsocketopt(context->sock, APR_SO_DISCONNECTED, &disconnected);
+ apr_socket_opt_get(context->sock, APR_SO_DISCONNECTED,
+ &disconnected);
if (!disconnected) {
context->accept_socket = INVALID_SOCKET;
ap_lingering_close(c);
*
* In spite of these problems, failure here is not a shooting offense.
*/
- apr_status_t status = apr_setsocketopt(s, APR_TCP_NODELAY, 1);
+ apr_status_t status = apr_socket_opt_set(s, APR_TCP_NODELAY, 1);
if (status != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, status, ap_server_conf,
- "setsockopt: (TCP_NODELAY)");
+ "apr_socket_opt_set: (TCP_NODELAY)");
}
}
#endif
#ifdef USE_SSL
if (ssl != 1)
#endif
- apr_setsocketopt(c->aprsock, APR_SO_TIMEOUT, 0);
+ apr_socket_timeout_set(c->aprsock, 0);
c->connect = tnow;
c->rwrite = reqlen;
c->rwrote = 0;
SOCK_STREAM, c->ctx)) != APR_SUCCESS) {
apr_err("socket", rv);
}
- if ((rv = apr_setsocketopt(c->aprsock, APR_SO_NONBLOCK, 1))
+ if ((rv = apr_socket_opt_set(c->aprsock, APR_SO_NONBLOCK, 1))
!= APR_SUCCESS) {
apr_err("socket nonblock", rv);
}
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.110 $> apache-2.0");
+ printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.111 $> apache-2.0");
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Copyright (c) 1998-2002 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", AP_AB_BASEREVISION, "$Revision: 1.110 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.111 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");