httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Tue, 13 Jan 2004 02:11:14 GMT
nd          2004/01/12 18:11:14

  Modified:    .        CHANGES
               modules/mappers mod_rewrite.c
  Log:
  weekday and monthnames are locale dependent...
  
  Revision  Changes    Path
  1.1366    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1365
  retrieving revision 1.1366
  diff -u -u -r1.1365 -r1.1366
  --- CHANGES	13 Jan 2004 00:33:01 -0000	1.1365
  +++ CHANGES	13 Jan 2004 02:11:14 -0000	1.1366
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_rewrite: Cookie creation now works locale independent.
  +     [André Malo]
  +
     *) mod_usertrack no longer inspects the Cookie2 header for
        the cookie name. PR 11475.  [Chris Darrochi <chrisd pearsoncmg.com>]
   
  
  
  
  1.240     +18 -9     httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.239
  retrieving revision 1.240
  diff -u -u -r1.239 -r1.240
  --- mod_rewrite.c	12 Jan 2004 22:36:32 -0000	1.239
  +++ mod_rewrite.c	13 Jan 2004 02:11:14 -0000	1.240
  @@ -2265,21 +2265,30 @@
           notename = apr_pstrcat(rmain->pool, var, "_rewrite", NULL);
           apr_pool_userdata_get(&data, notename, rmain->pool);
           if (!data) {
  +            char *exp_time = NULL;
  +
               expires = apr_strtok(NULL, ":", &tok_cntx);
               path = expires ? apr_strtok(NULL, ":", &tok_cntx) : NULL;
   
  +            if (expires) {
  +                apr_time_exp_t tms;
  +                apr_time_exp_gmt(&tms, r->request_time
  +                                     + apr_time_from_sec((60 * atol(expires))));
  +                exp_time = apr_psprintf(r->pool, "%s, %.2d-%s-%.4d "
  +                                                 "%.2d:%.2d:%.2d GMT",
  +                                        apr_day_snames[tms.tm_wday],
  +                                        tms.tm_mday,
  +                                        apr_month_snames[tms.tm_mon],
  +                                        tms.tm_year+1900,
  +                                        tms.tm_hour, tms.tm_min, tms.tm_sec);
  +            }
  +
               cookie = apr_pstrcat(rmain->pool,
                                    var, "=", val,
  -                                 "; path=", (path)? path : "/",
  +                                 "; path=", path ? path : "/",
                                    "; domain=", domain,
  -                                 (expires)? "; expires=" : NULL,
  -                                 (expires)?
  -                                 ap_ht_time(r->pool,
  -                                            r->request_time +
  -                                            apr_time_from_sec((60 *
  -                                                               atol(expires))),
  -                                            "%a, %d-%b-%Y %T GMT", 1)
  -                                          : NULL,
  +                                 expires ? "; expires=" : NULL,
  +                                 expires ? exp_time : NULL,
                                    NULL);
   
               apr_table_add(rmain->err_headers_out, "Set-Cookie", cookie);
  
  
  

Mime
View raw message