]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add RFC4331 quotas for mod_dav_fs
authormanu <manu@unknown>
Thu, 2 Mar 2023 16:09:50 +0000 (16:09 +0000)
committermanu <manu@unknown>
Thu, 2 Mar 2023 16:09:50 +0000 (16:09 +0000)
Fix warnings

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907989 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/fs/quota.c

index cbbc6871a046ac77c25d27edb2b70ba0187efe29..8f87f37ec85c420ba0165107605acd364cdc9890 100644 (file)
@@ -69,7 +69,7 @@ static apr_status_t get_dir_used_bytes_walk(request_rec *r,
         if (rv != APR_SUCCESS && rv != APR_INCOMPLETE)
             break;
 
-        if (finfo.valid & APR_FINFO_NAME == 0) {
+        if ((finfo.valid & APR_FINFO_NAME) == 0) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                           "Cannot get entry name in \"%s\"", path);
             goto out;
@@ -81,7 +81,7 @@ static apr_status_t get_dir_used_bytes_walk(request_rec *r,
             !strncmp(finfo.name, DAV_FS_TMP_PREFIX, strlen(DAV_FS_TMP_PREFIX)))
             continue;
 
-        if (finfo.valid & APR_FINFO_TYPE == 0) {
+        if ((finfo.valid & APR_FINFO_TYPE) == 0) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                           "Cannot get entry type in \"%s\"", path);
             goto out;
@@ -89,7 +89,7 @@ static apr_status_t get_dir_used_bytes_walk(request_rec *r,
 
         switch (finfo.filetype) {
         case APR_REG:
-            if (finfo.valid & APR_FINFO_SIZE == 0) {
+            if ((finfo.valid & APR_FINFO_SIZE) == 0) {
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                               "Cannot get entry size in \"%s\"", path);
                 goto out;
@@ -98,7 +98,7 @@ static apr_status_t get_dir_used_bytes_walk(request_rec *r,
             break;
 
         case APR_DIR:
-            if (finfo.valid & APR_FINFO_NAME == 0) {
+            if ((finfo.valid & APR_FINFO_NAME) == 0) {
                 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                               "Cannot get entry name in \"%s\"", path);
                 goto out;
@@ -142,7 +142,6 @@ static apr_off_t get_dir_used_bytes(request_rec *r, const char *path)
 
     rv = get_dir_used_bytes_walk(r, path, &used_bytes);
 
-out:
     return (rv == APR_SUCCESS) ? used_bytes : DAV_FS_BYTES_ERROR;
 }
 
@@ -161,8 +160,8 @@ static apr_off_t get_fs_used_bytes(const char *path)
     used_bytes = (f.f_blocks - f.f_bfree) * f.f_bsize;
 #endif
 
-#endif
 out:
+#endif
     return used_bytes;
 }
 
@@ -180,8 +179,8 @@ static apr_off_t get_fs_available_bytes(const char *path)
 #else
     available_bytes = f.f_bavail * f.f_bsize;
 #endif
-#endif
 out:
+#endif
     return available_bytes;
 }
 
@@ -270,14 +269,12 @@ int dav_fs_quota_precondition(request_rec *r,
                               const apr_xml_doc *doc, dav_error **err)
 {
     apr_off_t quota;
-    apr_off_t used_bytes;
     apr_off_t available_bytes;
     apr_off_t size;
     const char *path;
     const char *lenhdr;
     const char *tag;
     const char *msg;
-    apr_status_t rv;
     int status = DECLINED;
     int fs_low;