411 resource->addproperty(resource, webdav_resourcetype_empty(), 200); |
411 resource->addproperty(resource, webdav_resourcetype_empty(), 200); |
412 } |
412 } |
413 } |
413 } |
414 if(vfsprops.getlastmodified) { |
414 if(vfsprops.getlastmodified) { |
415 char *lastmodified = PQgetvalue(result, r, 5); |
415 char *lastmodified = PQgetvalue(result, r, 5); |
|
416 time_t t = pg_convert_timestamp(lastmodified); |
|
417 struct tm tm; |
|
418 gmtime_r(&t, &tm); |
|
419 |
|
420 char buf[HTTP_DATE_LEN+1]; |
|
421 strftime(buf, HTTP_DATE_LEN, HTTP_DATE_FMT, &tm); |
|
422 webdav_resource_add_dav_stringproperty(resource, pool, "getcontentlength", buf, strlen(buf)); |
416 } |
423 } |
417 if(vfsprops.creationdate) { |
424 if(vfsprops.creationdate) { |
418 char *creationdate = PQgetvalue(result, r, 6); |
425 char *creationdate = PQgetvalue(result, r, 6); |
|
426 webdav_resource_add_dav_stringproperty(resource, pool, "creationdate", creationdate, strlen(creationdate)); |
419 } |
427 } |
420 if(vfsprops.getcontentlength) { |
428 if(vfsprops.getcontentlength) { |
421 char *contentlength = PQgetvalue(result, r, 7); |
429 char *contentlength = PQgetvalue(result, r, 7); |
422 webdav_resource_add_dav_stringproperty(resource, pool, "getcontentlength", contentlength, strlen(contentlength)); |
430 webdav_resource_add_dav_stringproperty(resource, pool, "getcontentlength", contentlength, strlen(contentlength)); |
423 } |
431 } |