Commit 43cc819b authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Kill off some expensive, unnecessary effort when we use max-age for
  the usertrack cookie (and kill a warning in the process.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91215 13f79535-47bb-0310-9956-ffa450edef68
parent 3f5baa12
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -149,21 +149,15 @@ static void make_cookie(request_rec *r)
    apr_snprintf(cookiebuf, sizeof(cookiebuf), "%s.%qd", rname, apr_time_now());

    if (cls->expires) {
	apr_exploded_time_t tms;
        time_t when;

        when = cls->expires;
        if ((dcfg->style == CT_UNSET) || (dcfg->style == CT_NETSCAPE)) {
            when += r->request_time;
        }

	apr_explode_gmt(&tms,
                        r->request_time + cls->expires * APR_USEC_PER_SEC);

        /* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */
        new_cookie = apr_psprintf(r->pool, "%s=%s; path=/",
                                  dcfg->cookie_name, cookiebuf);

        if ((dcfg->style == CT_UNSET) || (dcfg->style == CT_NETSCAPE)) {
	    apr_exploded_time_t tms;
            apr_explode_gmt(&tms, r->request_time 
                                + cls->expires * APR_USEC_PER_SEC);
            new_cookie = apr_psprintf(r->pool,
                                       "%s; expires=%s, "
                                       "%.2d-%s-%.2d %.2d:%.2d:%.2d GMT",
@@ -175,7 +169,7 @@ static void make_cookie(request_rec *r)
        }
        else {
            new_cookie = apr_psprintf(r->pool, "%s; max-age=%d",
                                      new_cookie, (int) when);
                                      new_cookie, cls->expires);
        }
    }
    else {