Commit Graph

52 Commits

Author SHA1 Message Date
josch
dcce69e66d limit line length to 79 characters 2014-09-25 19:38:48 +02:00
josch
32fcb30572 fix indentation 2014-09-25 19:34:03 +02:00
josch
fd13d973ba fix memory leak in list command 2014-09-25 19:32:28 +02:00
josch
0fab559a86 Don't let api_folder_get_content print but let it fill datastructures 2014-09-25 19:27:49 +02:00
josch
44ba88a69d make valgrind return non-zero exit on failure 2014-09-25 19:25:57 +02:00
josch
975e75cc6f mfshell: add changes command, mfapi: add device/get_changes 2014-09-25 13:04:40 +02:00
josch
2e28ae16e2 remove some useless includes 2014-09-24 21:28:22 +02:00
josch
dacb6937f1 remove unused variable 2014-09-24 21:22:04 +02:00
josch
c763863d27 remove epoch 2014-09-24 21:20:21 +02:00
josch
095a05ec3c check strftime return value 2014-09-24 21:16:41 +02:00
josch
a63ee3f84e mfapi/folder.c: remove unnecessary struct members 2014-09-24 21:11:50 +02:00
josch
063db92a97 temporary workaround for ubuntu: link with --no-as-needed 2014-09-24 21:07:07 +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
0561a922c5 mfshell: add new folder command 2014-09-24 10:48:54 +02:00
josch
18db8742dd remove "myfiles" as a moniker for the root. Use NULL or empty string instead 2014-09-24 09:34:56 +02:00
josch
00ff91c15a fuse: add more options and establish connection on startup 2014-09-23 20:53:29 +02:00
josch
6e546fa3f3 some stderr output on error 2014-09-23 20:52:30 +02:00
josch
7e4717c18f mfconn_create: abort early on faulty input 2014-09-23 19:30:50 +02:00
josch
ab728c93da make App ID and API Key configurable via commandline 2014-09-23 19:18:23 +02:00
josch
036954df35 allow to pass no api_key when constructing the signature 2014-09-23 18:53:16 +02:00
josch
60e0824f68 mfapi/apicalls/user_session.c: don't use hardcoded application_id 2014-09-23 18:24:09 +02:00
josch
8e1fd0e41d add skeleton for fuse module 2014-09-23 15:12:19 +02:00
josch
f85072e465 refactor option and config handling 2014-09-23 14:02:30 +02:00
josch
cf410aa820 utils/http.h: fix whitespace typo 2014-09-23 13:31:47 +02:00
josch
eb9dde4457 add .gitignore to not accidentally add .mediafire-tools.conf 2014-09-23 11:39:26 +02:00
josch
e14d91ca1d mfshell: add configuration file parsing 2014-09-23 11:38:10 +02:00
josch
8f726ab5e5 allow to pass username and password by commandline arguments 2014-09-23 09:29:04 +02:00
josch
08c067a352 add const qualifiers to some variables 2014-09-23 09:28:58 +02:00
josch
675679acf7 fix segmentation fault when quitting without logging in 2014-09-23 09:28:30 +02:00
josch
164de0782f allow in-tree builds (rename mfshell executable) 2014-09-23 09:28:30 +02:00
josch
042a1cdf09 Add valgrind tests and fix memleaks 2014-09-23 09:28:24 +02:00
josch
122db2ed82 tests/iwyu.py: print diff if descrepancy is found 2014-09-20 14:39:24 +02:00
josch
e10ed72a48 tests/indent.sh: use find because dash cannot expand ** 2014-09-20 14:38:26 +02:00
josch
e45d0e883d add rmdir shell command and folder_delete api call 2014-09-20 14:37:24 +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
josch
2d6a79062a fix segfault when line only contains newline 2014-09-17 21:55:59 +02:00
josch
ebedf596db Replace cfile.c with connection.c
- cfile.h needed too many function calls and was too complex
 - connection.h does
     - only download in binary mode (json can handle that)
     - have no excess of getters and setters
     - allow to execute the whole request in a single function call
     - allow to be re-used for multiple requests
 - as a result, the code has 600 lines of code less
 - originally, connection.h was developed to use a global curl
   handle for all requests such that the same connection could be
   re-used. Unfortunately the MediaFire servers will close the
   connection after each request from their end:

      Bryan: "Unfortunately, we won't ever do keep-alive.  Closing the
      connection is a small part of a larger set of heuristics we have in
      place to prevent DOS/DDOS attacks."

   This causes massive performance impacts and those grow even larger when
   using SSL because the handshake has to be executed for every single
   request again.
2014-09-17 21:21:20 +02:00
josch
fe42b6e668 use wordexp instead of stringv_split for argument parsing 2014-09-17 08:36:45 +02:00
josch
540b603b41 Add commandline argument parser
- add several commandline options to read username, password and server
   from the commandline
 - add help output to the commandline
 - do not automatically call auth upon start-up because the user might
   want to run commands like "help" which do not require to be signed in
 - add -c option which, like for dash and bash allows to receive
   commands via the commandline instead of standard input
2014-09-17 08:36:45 +02:00
josch
b25e4ad7d8 add function to execute raw commands via argc and argv 2014-09-17 08:36:45 +02:00
josch
c57ccd6df1 allow username and password as arguments to auth command 2014-09-17 08:36:45 +02:00
josch
08b808f893 Refactor commandline handling
- instead of having the list of commandline arguments, their handlers
   and their help strings in different places, unify them in a single
   array
 - this allows to only change one piece of code when adding new
   arguments
2014-09-17 08:36:38 +02:00
josch
e8f3164374 remove cacert.pem 2014-09-16 09:30:40 +02:00
josch
48ce3f7e95 compile with cmake 2014-09-16 08:04:06 +02:00