588 } |
588 } |
589 |
589 |
590 if(!S_ISDIR(st.st_mode)) { |
590 if(!S_ISDIR(st.st_mode)) { |
591 prop.name = "getcontentlength"; |
591 prop.name = "getcontentlength"; |
592 char buf[32]; |
592 char buf[32]; |
593 size_t n = snprintf(buf, 32, "%lld", st.st_size); |
593 size_t n = snprintf(buf, 32, "%jd", st.st_size); |
594 dav_propfind_add_str_prop(rq, &prop, buf, n); |
594 dav_propfind_add_str_prop(rq, &prop, buf, n); |
595 } |
595 } |
596 |
596 |
597 prop.name = "getlastmodified"; |
597 prop.name = "getlastmodified"; |
598 |
598 |
616 } else { |
616 } else { |
617 dav_propfind_add_str_prop(rq, prop, NULL, 0); |
617 dav_propfind_add_str_prop(rq, prop, NULL, 0); |
618 } |
618 } |
619 } else if(!strcmp(s, "getcontentlength") && !S_ISDIR(st.st_mode)) { |
619 } else if(!strcmp(s, "getcontentlength") && !S_ISDIR(st.st_mode)) { |
620 char buf[32]; |
620 char buf[32]; |
621 size_t n = snprintf(buf, 32, "%lld", st.st_size); |
621 size_t n = snprintf(buf, 32, "%jd", st.st_size); |
622 dav_propfind_add_str_prop(rq, prop, buf, n); |
622 dav_propfind_add_str_prop(rq, prop, buf, n); |
623 } else if(!strcmp(s, "getlastmodified")) { |
623 } else if(!strcmp(s, "getlastmodified")) { |
624 sstr_t s = date_format_http(st.st_mtime, rq->sn->pool); |
624 sstr_t s = date_format_http(st.st_mtime, rq->sn->pool); |
625 dav_propfind_add_str_prop(rq, prop, s.ptr, s.length); |
625 dav_propfind_add_str_prop(rq, prop, s.ptr, s.length); |
626 } else if(!strcmp(s, "creationdate")) { |
626 } else if(!strcmp(s, "creationdate")) { |