bug fix: file size > 2gb not loaded correctly from database

Thu, 07 Sep 2017 18:42:51 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 07 Sep 2017 18:42:51 +0200
changeset 300
4e3769d4e782
parent 299
c517502d3e38
child 302
395763c0ee69

bug fix: file size > 2gb not loaded correctly from database

this bug results in large files always pushed, even if they are unmodified

dav/db.c file | annotate | diff | comparison | revisions
--- a/dav/db.c	Thu Sep 07 18:18:30 2017 +0200
+++ b/dav/db.c	Thu Sep 07 18:42:51 2017 +0200
@@ -152,7 +152,13 @@
                     break;
                 }
                 case 3: {
-                    res->size = atoi((char*)value);
+                    res->size = 0;
+                    int64_t filelen = 0;
+                    if(util_strtoint((char*)value, &filelen)) {
+                        if(filelen > 0) {
+                            res->size = (size_t)filelen;
+                        }
+                    }
                     break;
                 }
             }

mercurial