36 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
f0a55615ae urlencode all filenames, foldernames, username and password 2015-01-16 08:49:23 +01:00
root
636d22504c user older option for setting timeout to support older systems 2014-12-29 22:08:10 -06:00
josch
80036b5bd9 move loop polling for upload completion into separate function 2014-12-29 13:57:53 +01:00
root
b83eb74551 set a 5 second connection timeout at the curl layer 2014-12-28 14:00:23 -06:00
root
a207c28172 fix up files in utils directory for strdup on old systems 2014-12-27 17:17:03 -06:00
root
ab617c2d51 fix up files in utils directory to support getline on old systems 2014-12-27 17:15:24 -06:00
josch
4b3ef3bf31 fix upload progress counter 2014-12-21 07:47:12 +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
c8a0f2a942 add upload/patch 2014-12-07 15:38:50 +01:00
josch
a95a0f5c48 fill headers outside of http_post_file 2014-12-07 15:03:38 +01:00
josch
c04151f2e1 remove json_object_by_path 2014-12-05 14:27:31 +01:00
josch
fa609e465d add some stub for mitm testing 2014-12-05 13:48:47 +01:00
josch
f5b09193f9 http: properly reset all values of curl connection 2014-12-05 13:09:56 +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
f1bf926145 Allow file upload
- add upload/simple
 - add upload/poll_upload
 - add "put" command to mfshell
 - add http POST method
2014-12-04 10:34:54 +01:00
josch
58e8e89771 move file integrity checks from fuse/filecache to utils/hash 2014-12-02 07:10: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
febb29f75c Add support for updating local cache through patches
- refactor some code:
   - code handling the file cache is now in fuse/filecache.c
   - base36 and base16 encoding and decoding moved to utils/hash.c
 - mfshell: add "updates" command calling device/get_updates
 - add container class to store patch information as mfapi/patch.c
 - apicalls: store more info retrieved by file/get_info
 - apicalls: add device/get_updates
 - apicalls: add device/get_patch
2014-12-01 16:30:32 +01:00
josch
511cda2c8f calculate and check hash of downloaded file 2014-11-05 13:40:25 +01:00
josch
254aaa6033 fix testsuite problems 2014-11-05 13:21:51 +01:00
josch
f281b4233d add diff and patch functions for xdelta3 2014-11-04 11:02:33 +01:00
josch
5e24f47c10 add more curl error output 2014-10-25 11:33:55 +02:00
josch
5a673abd1b fix valgrind problems 2014-10-19 08:58:56 +02:00
josch
5fa32f8878 build with std=c99 2014-10-02 08:20:08 +02:00
josch
b4045f19ce Add hashtable implementation to maintain a local copy of the remote 2014-09-26 15:19:55 +02:00
josch
dcce69e66d limit line length to 79 characters 2014-09-25 19:38:48 +02:00
josch
0561a922c5 mfshell: add new folder command 2014-09-24 10:48:54 +02:00
josch
cf410aa820 utils/http.h: fix whitespace typo 2014-09-23 13:31:47 +02:00
josch
097a855751 use gnu indent to enforce coding style and adapt source
- indent options are listed in ./.indent.pro
 - use test case to run indent
2014-09-20 12:29:39 +02:00
josch
d8e00119b4 add test with iwyu and fix all headers accordingly 2014-09-20 10:31:55 +02:00
josch
4b2563d800 remove the _t postfix from type names because POSIX reserves types ending in _t 2014-09-19 23:13:29 +02:00
josch
e0ee1e5f8f fix clang warnings 2014-09-19 21:14:30 +02:00
josch
b322f68ad2 build with -Wall -Wextra -Werror and fix errors 2014-09-19 17:08:24 +02:00
josch
ef3b2aa844 Refactor code into utils, mfapi and mfshell
- utils is the low level library used by the others
 - mfapi uses utils and implements the api and some wrappers
 - mfshell uses mfapi and utils to provide a shell
2014-09-19 17:08:20 +02:00