Note: picked up from ap_gm_timestr_822() */ NOTE: buf must be at least DAV_TIMEBUF_SIZE chars in size */
| 296 | /* Note: picked up from ap_gm_timestr_822() */ |
| 297 | /* NOTE: buf must be at least DAV_TIMEBUF_SIZE chars in size */ |
| 298 | static void dav_format_time(int style, apr_time_t sec, char *buf, apr_size_t buflen) |
| 299 | { |
| 300 | apr_time_exp_t tms; |
| 301 | |
| 302 | /* ### what to do if fails? */ |
| 303 | (void) apr_time_exp_gmt(&tms, sec); |
| 304 | |
| 305 | if (style == DAV_STYLE_ISO8601) { |
| 306 | /* ### should we use "-00:00" instead of "Z" ?? */ |
| 307 | |
| 308 | /* 20 chars plus null term */ |
| 309 | apr_snprintf(buf, buflen, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2dZ", |
| 310 | tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday, |
| 311 | tms.tm_hour, tms.tm_min, tms.tm_sec); |
| 312 | return; |
| 313 | } |
| 314 | |
| 315 | /* RFC 822 date format; as strftime '%a, %d %b %Y %T GMT' */ |
| 316 | |
| 317 | /* 29 chars plus null term */ |
| 318 | apr_snprintf(buf, buflen, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", |
| 319 | apr_day_snames[tms.tm_wday], |
| 320 | tms.tm_mday, apr_month_snames[tms.tm_mon], |
| 321 | tms.tm_year + 1900, |
| 322 | tms.tm_hour, tms.tm_min, tms.tm_sec); |
| 323 | } |
| 324 | |
| 325 | /* Copy or move src to dst; src_finfo is used to propagate permissions |
| 326 | * bits across if non-NULL; dst_finfo must be non-NULL iff dst already |
no outgoing calls
no test coverage detected