Commit 5524518b authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Solve the 80/20 by initializing and storing server_rec->timeout and
  server_rec->keep_alive_timeout in apr_time_interval_t format (in apr
  units, whatever they be), as both values exist to pass into APR, and
  all APR timeouts are in apr_time_t.

Reviewed by:	Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95623 13f79535-47bb-0310-9956-ffa450edef68
parent ecdf0821
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -107,12 +107,13 @@
 * 20020506 (2.0.37-dev) Removed r->boundary in request_rec.
 * 20020529 (2.0.37-dev) Standardized the names of some apr_pool_*_set funcs
 * 20020602 (2.0.37-dev) Bucket API change (metadata buckets)
 * 20020612 (2.0.38-dev) Changed server_rec->[keep_alive_]timeout to apr time
 */

#define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */

#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20020602
#define MODULE_MAGIC_NUMBER_MAJOR 20020612
#endif
#define MODULE_MAGIC_NUMBER_MINOR 1                     /* 0...n */

+4 −4
Original line number Diff line number Diff line
@@ -1078,10 +1078,10 @@ struct server_rec {

    /** I haven't got a clue */
    server_addr_rec *addrs;
    /** Timeout, in seconds, before we give up */
    int timeout;
    /** Seconds we'll wait for another request */
    int keep_alive_timeout;
    /** Timeout, as an apr interval, before we give up */
    apr_interval_time_t timeout;
    /** The apr interval we will wait for another request */
    apr_interval_time_t keep_alive_timeout;
    /** Maximum requests per connection */
    int keep_alive_max;
    /** Use persistent connections? */
+2 −2
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ static apr_status_t pass_data_to_filter(ap_filter_t *f, const char *data,
                
                rv = apr_poll(ctx->pollset,
                              &num_events,
                              f->r->server->timeout * APR_USEC_PER_SEC);
                              f->r->server->timeout);
                if (rv || dc->debug >= DBGLVL_GORY) {
                    ap_log_rerror(APLOG_MARK, APLOG_DEBUG,
                                  rv, f->r, "apr_poll()");
@@ -696,7 +696,7 @@ static apr_status_t ef_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
         * timeout; we don't care if we don't return from apr_file_read() for a while... 
         */
        rv = apr_file_pipe_timeout_set(ctx->proc->out, 
                                  r->server->timeout * APR_USEC_PER_SEC);
                                       r->server->timeout);
        if (rv) {
            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
                          "apr_file_pipe_timeout_set(child output)");
+3 −8
Original line number Diff line number Diff line
@@ -490,23 +490,18 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
            *script_in = procnew->out;
            if (!*script_in)
                return APR_EBADF;
            apr_file_pipe_timeout_set(*script_in, (int)(r->server->timeout *
                                                        APR_USEC_PER_SEC));
            apr_file_pipe_timeout_set(*script_in, r->server->timeout);

            if (e_info->prog_type == RUN_AS_CGI) {
                *script_out = procnew->in;
                if (!*script_out)
                    return APR_EBADF;
                apr_file_pipe_timeout_set(*script_out,
                                          (int)(r->server->timeout *
                                                APR_USEC_PER_SEC));
                apr_file_pipe_timeout_set(*script_out, r->server->timeout);

                *script_err = procnew->err;
                if (!*script_err)
                    return APR_EBADF;
                apr_file_pipe_timeout_set(*script_err,
                                          (int)(r->server->timeout *
                                                APR_USEC_PER_SEC));
                apr_file_pipe_timeout_set(*script_err, r->server->timeout);
            }
        }
    }
+2 −1
Original line number Diff line number Diff line
@@ -395,7 +395,8 @@ static int display_info(request_rec *r)
            ap_rprintf(r, "<dt><strong>Timeouts:</strong> "
                        "<tt>connection: %d &nbsp;&nbsp; "
                        "keep-alive: %d</tt></dt>",
                        serv->timeout, serv->keep_alive_timeout);
                        (int)(apr_time_sec(serv->timeout)), 
                        (int)(apr_time_sec(serv->timeout)));
            ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons);
            ap_mpm_query(AP_MPMQ_IS_THREADED, &threaded);
            ap_mpm_query(AP_MPMQ_IS_FORKED, &forked);
Loading