src/server/webdav/webdav.c

changeset 69
4a10bc0ee80d
parent 64
c7f5b062e622
child 70
4e6e812c1d97
equal deleted inserted replaced
68:f5102a892ed4 69:4a10bc0ee80d
575 size_t n = snprintf(buf, 32, "%d", st.st_size); 575 size_t n = snprintf(buf, 32, "%d", st.st_size);
576 dav_propfind_add_str_prop(rq, &prop, buf, n); 576 dav_propfind_add_str_prop(rq, &prop, buf, n);
577 } 577 }
578 578
579 prop.name = "getlastmodified"; 579 prop.name = "getlastmodified";
580 sstr_t s = date_format_http(st.st_mtim.tv_sec, rq->sn->pool); 580
581 sstr_t s = date_format_http(st.st_mtime, rq->sn->pool);
581 dav_propfind_add_str_prop(rq, &prop, s.ptr, s.length); 582 dav_propfind_add_str_prop(rq, &prop, s.ptr, s.length);
582 583
583 prop.name = "creationdate"; 584 prop.name = "creationdate";
584 s = date_format_iso8601(st.st_ctim.tv_sec, rq->sn->pool); 585 s = date_format_iso8601(st.st_ctime, rq->sn->pool);
585 dav_propfind_add_str_prop(rq, &prop, s.ptr, s.length); 586 dav_propfind_add_str_prop(rq, &prop, s.ptr, s.length);
586 587
587 return; 588 return;
588 } 589 }
589 590
600 } else if(!strcmp(s, "getcontentlength") && !S_ISDIR(st.st_mode)) { 601 } else if(!strcmp(s, "getcontentlength") && !S_ISDIR(st.st_mode)) {
601 char buf[32]; 602 char buf[32];
602 size_t n = snprintf(buf, 32, "%d", st.st_size); 603 size_t n = snprintf(buf, 32, "%d", st.st_size);
603 dav_propfind_add_str_prop(rq, prop, buf, n); 604 dav_propfind_add_str_prop(rq, prop, buf, n);
604 } else if(!strcmp(s, "getlastmodified")) { 605 } else if(!strcmp(s, "getlastmodified")) {
605 sstr_t s = date_format_http(st.st_mtim.tv_sec, rq->sn->pool); 606 sstr_t s = date_format_http(st.st_mtime, rq->sn->pool);
606 dav_propfind_add_str_prop(rq, prop, s.ptr, s.length); 607 dav_propfind_add_str_prop(rq, prop, s.ptr, s.length);
607 } else if(!strcmp(s, "creationdate")) { 608 } else if(!strcmp(s, "creationdate")) {
608 sstr_t s = date_format_iso8601(st.st_ctim.tv_sec, rq->sn->pool); 609 sstr_t s = date_format_iso8601(st.st_ctime, rq->sn->pool);
609 dav_propfind_add_str_prop(rq, prop, s.ptr, s.length); 610 dav_propfind_add_str_prop(rq, prop, s.ptr, s.length);
610 } else { 611 } else {
611 dav_propfind_add_prop_error(rq, prop, 404); 612 dav_propfind_add_prop_error(rq, prop, 404);
612 } 613 }
613 } 614 }

mercurial