Commit Graph

10 Commits

Author SHA1 Message Date
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
josch
9b36c98544 add license header to all files and LICENSE file with GPL-2 2014-09-15 20:22:02 +02:00
josch
ad1fea5a78 initial commit - import mediafire-shell sources 2014-09-15 20:00:05 +02:00