stat.c (302408) | stat.c (362181) |
---|---|
1/* 2 * stat.c : file and directory stat and read functions 3 * 4 * ==================================================================== 5 * Licensed to the Apache Software Foundation (ASF) under one 6 * or more contributor license agreements. See the NOTICE file 7 * distributed with this work for additional information 8 * regarding copyright ownership. The ASF licenses this file --- 179 unchanged lines hidden (view full) --- 188 fdb->entry->has_props = TRUE; 189 } 190 else if (strcmp(ns, SVN_DAV_PROP_NS_DAV) == 0) 191 { 192 if(strcmp(name, "deadprop-count") == 0) 193 { 194 if (*val->data) 195 { | 1/* 2 * stat.c : file and directory stat and read functions 3 * 4 * ==================================================================== 5 * Licensed to the Apache Software Foundation (ASF) under one 6 * or more contributor license agreements. See the NOTICE file 7 * distributed with this work for additional information 8 * regarding copyright ownership. The ASF licenses this file --- 179 unchanged lines hidden (view full) --- 188 fdb->entry->has_props = TRUE; 189 } 190 else if (strcmp(ns, SVN_DAV_PROP_NS_DAV) == 0) 191 { 192 if(strcmp(name, "deadprop-count") == 0) 193 { 194 if (*val->data) 195 { |
196 /* Note: 1.8.x and earlier servers send the count proper; 1.9.0 197 * and newer send "1" if there are properties and "0" otherwise. 198 */ |
|
196 apr_int64_t deadprop_count; 197 SVN_ERR(svn_cstring_atoi64(&deadprop_count, val->data)); 198 fdb->entry->has_props = deadprop_count > 0; 199 if (fdb->supports_deadprop_count) 200 *fdb->supports_deadprop_count = svn_tristate_true; 201 } 202 else if (fdb->supports_deadprop_count) 203 *fdb->supports_deadprop_count = svn_tristate_false; --- 4 unchanged lines hidden (view full) --- 208} 209 210static const svn_ra_serf__dav_props_t * 211get_dirent_props(apr_uint32_t dirent_fields, 212 svn_ra_serf__session_t *session, 213 apr_pool_t *pool) 214{ 215 svn_ra_serf__dav_props_t *prop; | 199 apr_int64_t deadprop_count; 200 SVN_ERR(svn_cstring_atoi64(&deadprop_count, val->data)); 201 fdb->entry->has_props = deadprop_count > 0; 202 if (fdb->supports_deadprop_count) 203 *fdb->supports_deadprop_count = svn_tristate_true; 204 } 205 else if (fdb->supports_deadprop_count) 206 *fdb->supports_deadprop_count = svn_tristate_false; --- 4 unchanged lines hidden (view full) --- 211} 212 213static const svn_ra_serf__dav_props_t * 214get_dirent_props(apr_uint32_t dirent_fields, 215 svn_ra_serf__session_t *session, 216 apr_pool_t *pool) 217{ 218 svn_ra_serf__dav_props_t *prop; |
216 apr_array_header_t *props = apr_array_make 217 (pool, 7, sizeof(svn_ra_serf__dav_props_t)); | 219 apr_array_header_t *props = svn_ra_serf__get_dirent_props(dirent_fields, 220 session, pool); |
218 | 221 |
219 if (session->supports_deadprop_count != svn_tristate_false 220 || ! (dirent_fields & SVN_DIRENT_HAS_PROPS)) 221 { 222 if (dirent_fields & SVN_DIRENT_KIND) 223 { 224 prop = apr_array_push(props); 225 prop->xmlns = "DAV:"; 226 prop->name = "resourcetype"; 227 } 228 229 if (dirent_fields & SVN_DIRENT_SIZE) 230 { 231 prop = apr_array_push(props); 232 prop->xmlns = "DAV:"; 233 prop->name = "getcontentlength"; 234 } 235 236 if (dirent_fields & SVN_DIRENT_HAS_PROPS) 237 { 238 prop = apr_array_push(props); 239 prop->xmlns = SVN_DAV_PROP_NS_DAV; 240 prop->name = "deadprop-count"; 241 } 242 243 if (dirent_fields & SVN_DIRENT_CREATED_REV) 244 { 245 svn_ra_serf__dav_props_t *p = apr_array_push(props); 246 p->xmlns = "DAV:"; 247 p->name = SVN_DAV__VERSION_NAME; 248 } 249 250 if (dirent_fields & SVN_DIRENT_TIME) 251 { 252 prop = apr_array_push(props); 253 prop->xmlns = "DAV:"; 254 prop->name = SVN_DAV__CREATIONDATE; 255 } 256 257 if (dirent_fields & SVN_DIRENT_LAST_AUTHOR) 258 { 259 prop = apr_array_push(props); 260 prop->xmlns = "DAV:"; 261 prop->name = "creator-displayname"; 262 } 263 } 264 else 265 { 266 /* We found an old subversion server that can't handle 267 the deadprop-count property in the way we expect. 268 269 The neon behavior is to retrieve all properties in this case */ 270 prop = apr_array_push(props); 271 prop->xmlns = "DAV:"; 272 prop->name = "allprop"; 273 } 274 | |
275 prop = apr_array_push(props); 276 prop->xmlns = NULL; 277 prop->name = NULL; 278 279 return (svn_ra_serf__dav_props_t *) props->elts; 280} 281 282/* Implements svn_ra__vtable_t.stat(). */ --- 333 unchanged lines hidden --- | 222 prop = apr_array_push(props); 223 prop->xmlns = NULL; 224 prop->name = NULL; 225 226 return (svn_ra_serf__dav_props_t *) props->elts; 227} 228 229/* Implements svn_ra__vtable_t.stat(). */ --- 333 unchanged lines hidden --- |