- char *match;
- const char *expiration_date = cur_tag + 8; /* Skip "[Ee]xpires=" */
- memset(&tm_cookie, 0, sizeof(tm_cookie));
- /*
- * Try the valid time formats we know about.
- *
- * XXX: This should be moved to parse_header_time().
- *
- * XXX: Maybe the log messages should be removed
- * for the next stable release. They just exist to
- * see which time format gets the most hits and
- * should be checked for first.
- */
- if (NULL != (match = strptime(expiration_date, "%a, %e-%b-%y %H:%M:%S ", &tm_cookie)))
- {
- /* 22-Feb-2008 12:01:18 GMT */
- log_error(LOG_LEVEL_HEADER,
- "cookie \'%s\' send by %s appears to be using time format 1.",
- *header, csp->http->url);
- }
- else if (NULL != (match = strptime(expiration_date, "%A, %e-%b-%Y %H:%M:%S ", &tm_cookie)))
- {
- /* Tue, 02-Jun-2037 20:00:00 GMT */
- log_error(LOG_LEVEL_HEADER,
- "cookie \'%s\' send by %s appears to be using time format 2.",
- *header, csp->http->url);
- }
- else if (NULL != (match = strptime(expiration_date, "%a, %e-%b-%Y %H:%M:%S ", &tm_cookie)))
- {
- /* Tuesday, 02-Jun-2037 20:00:00 GMT */
- /*
- * On FreeBSD this is never reached because it's handled
- * by "format 2" as well. I am, however, not sure if all
- * strptime() implementations behave that way.
- */
- log_error(LOG_LEVEL_HEADER,
- "cookie \'%s\' send by %s appears to be using time format 3.",
- *header, csp->http->url);
- }
- else if (NULL != (match = strptime(expiration_date, "%a, %e %b %Y %H:%M:%S ", &tm_cookie)))
- {
- /* Fri, 22 Feb 2008 19:20:05 GMT */
- log_error(LOG_LEVEL_HEADER,
- "cookie \'%s\' send by %s appears to be using time format 4.",
- *header, csp->http->url);
- }
- else if (NULL != (match = strptime(expiration_date, "%A %b %e %H:%M:%S %Y", &tm_cookie)))
- {
- /* Thu Mar 08 23:00:00 2007 GMT */
- log_error(LOG_LEVEL_HEADER,
- "cookie \'%s\' send by %s appears to be using time format 5.",
- *header, csp->http->url);
- }