46 Commits

Author SHA1 Message Date
Aaron Hamilton
cf22aa9ff5 Use _DEFAULT_SOURCE instead of _BSD_SOURCE, since _BSD_SOURCE is deprecated. 2015-01-21 23:43:45 +00:00
josch
c87bbec03c fuse: when the hashtable fails to load, start a new one instead of failing 2015-01-19 17:18:10 +01:00
josch
d1a778ffe5 fix some indentation 2014-12-30 19:12:49 +01:00
josch
c09a663471 create ~/.config and ~/.cache should they not exist 2014-12-30 19:09:20 +01:00
josch
3fbb3b01ff on startup, check integrity of cached files and remove old cached files 2014-12-30 14:03:17 +01:00
josch
90dc1c2927 protect every fuse call by mutexes to allow mounting without -s option 2014-12-29 22:47:52 +01:00
josch
02e2eec1d4 only call device/get_status every 60 seconds (hardcoded for now) 2014-12-29 22:10:41 +01:00
josch
3b8ecf3bac store cache in subdirectory of user ekey 2014-12-29 19:32:15 +01:00
josch
a0c534b803 adjust includes according to iwyu 3.5 2014-12-29 09:54:42 +01:00
root
b50191bb0e fixed broken include for fcntl 2014-12-27 17:41:36 -06:00
root
e83ed07070 fix up files in the fuse directory for getline and strdup on old systems 2014-12-27 17:26:51 -06:00
josch
862bdcff80 add stubs for all fuse functions 2014-12-19 01:59:23 +01:00
josch
171fd815f2 allow to change local files
- fuse/filecache:
     * add filecache_upload_patch
     * allow opening files in modes other than RDONLY
 - fuse/hashtbl:
     * add folder_tree_upload_patch
 - fuse/operations:
     * allow opening files in modes other than RDONLY
     * add members to private context which allow tracking of
       not-yet-uploaded files and files opened for writing and
       files opened in read-only mode
 - mfapi/apicalls/upload_patch:
     * supply x-filename and x-filesize headers
 - mfapi/apicalls/upload_simple:
     * do not supply the x-filehash header as it is not used by the
       server
 - utils/hash:
     * hex characters must be lower case for the server
 - utils/strings:
     * clean up unused functions strdup_join, strdup_substr,
       string_chomp
 - utils/stringv:
     * complete rewrite with different string vector implementation
2014-12-18 20:29:47 +01:00
josch
5bd9e418c4 make everything work on freebsd 2014-12-09 15:30:13 +01:00
josch
8468a39c0a if apicall failed - retry 2014-12-06 11:04:04 +01:00
josch
816d79438f Allow to skip the device/get_status call when calling folder_tree_update
- this is useful to safe one extra call when it is known that there
   should be changes on the remote. In that case it will immediately
   skip forward to calling device/get_changes
2014-12-04 16:21:39 +01:00
josch
71f6396a9a Allow to create new files (but changing them is not allowed yet)
- since mediafire cannot deal with empty files, we put new files into a
   temporary location and upload them once they get closed
 - add create and write functions to fuse
 - pass a file handle to mfconn_api_upload_simple instead of a path
 - allow calc_sha256 to also compute the file size
 - error out when the key returned by upload/simple is empty
 - make valgrind.supp more lenient
2014-12-04 16:07:12 +01:00
josch
1e15dcc16b fuse: add unlink to remove files 2014-12-02 11:04:25 +01:00
josch
04dd1bcc71 now that we got rid of global variables, we can split the operations into their own file 2014-12-02 07:34:07 +01:00
josch
2f2ce91597 fix includes and indentation 2014-12-01 22:03:09 +01:00
josch
9c4195ebdd fuse: allow entering username and password via stdin
- when either username or password are not specified via commandline
   arguments or configuration file, ask them on standard input
 - unify function to read username and password
 - move function to read username and password from mfshell to
   utils/strings.c
 - remove commented cruft from utils/strings.c
2014-12-01 21:59:59 +01:00
josch
ffc933cf10 allow to start without a config file 2014-12-01 18:54:00 +01:00
josch
0abe0099be fail if hashtable cannot be loaded 2014-12-01 17:23:28 +01:00
josch
5034d361ba store dircache in proper directory 2014-11-14 13:28:19 +01:00
josch
d748f5e686 fuse/main.c: eliminate all global variables by using fuse private_data 2014-11-14 13:20:31 +01:00
josch
720d5da086 reorganize configuration and cache location handling
- follow XDG basedir spec
2014-11-03 20:33:48 +01:00
josch
3db5ce5c42 implement preliminary support to read files
* no writing yet
  * no delta updates yet - new versions will be retrieved fully
2014-10-27 14:17:06 +01:00
josch
21465f8943 create config directory in HOME and read config from there 2014-10-26 14:11:22 +01:00
josch
524fdf5824 add valgrind test for mediafire-fuse and fix memleaks 2014-10-25 11:39:26 +02:00
josch
fbad17827e fuse: allow to parse config file 2014-10-20 10:31:22 +02:00
josch
f23250aaef Allow to work with only partially filled tree
- avoid walking the whole tree on startup
 - introduce variable to keep track of which entries need updating
2014-10-19 08:43:57 +02:00
josch
8f728cf106 remove unused variables 2014-10-02 08:22:43 +02:00
josch
5fa32f8878 build with std=c99 2014-10-02 08:20:08 +02:00
josch
b0410cc1ac make synchronization with remote more robust 2014-09-29 16:49:11 +02:00
josch
d65f60ec81 rely on some properties of fuse to avoid checks and sanitizing 2014-09-29 10:53:34 +02:00
josch
fc520c6f5b Implement mkdir and rmdir 2014-09-28 09:37:24 +02:00
josch
43c0b09f70 hashtbl: do not expose h_entry at all 2014-09-28 07:39:13 +02:00
josch
690091721a Call folder/get_contents for updated folders in device/get_changes
- it is not enough to rely on the parent information of updated files
   because that misses files and folders that were completely removed
   (even from trash)
2014-09-27 23:06:09 +02:00
josch
53981a2229 allow persistent storage and loading of the remote tree 2014-09-27 20:20:24 +02:00
josch
b6f35763fa Optimize device/get_changes updates
- don't use folder/get_content but rely on parent information
 - add many more debugging information and sanity checks
 - ignore trash
 - correctly update local device revision using device_response
 - remove "visited" member and change housekeeping function to check for
   consistency of parents and children (and retrieve fix from remote if
   necessary)
 - print key and parent key in the debugging function
 - check for remote updates on every fs function
 - introduce global defines for key and filename length
 - add parent member, getters and setters to file.h
2014-09-27 14:05:11 +02:00
josch
da914e67b1 connect getattr and readdir to hashtbl 2014-09-26 16:10:31 +02:00
josch
b4045f19ce Add hashtable implementation to maintain a local copy of the remote 2014-09-26 15:19:55 +02:00
josch
29a343267d mfshell: add the status command and the device/get_status api call 2014-09-24 18:33:04 +02:00
josch
6ca27f0a6a fix indent test and indentation 2014-09-24 11:28:35 +02:00
josch
00ff91c15a fuse: add more options and establish connection on startup 2014-09-23 20:53:29 +02:00
josch
8e1fd0e41d add skeleton for fuse module 2014-09-23 15:12:19 +02:00