Added support for up.concealed.world
This commit is contained in:
parent
efc3ac374d
commit
68e00034bb
2 changed files with 15 additions and 4 deletions
Binary file not shown.
|
@ -26,6 +26,7 @@ main(int argc, char **argv)
|
||||||
struct curl_httppost *last = NULL;
|
struct curl_httppost *last = NULL;
|
||||||
|
|
||||||
char *token = NULL;
|
char *token = NULL;
|
||||||
|
char *form_key = "file";
|
||||||
|
|
||||||
char *buffer = (char *)calloc(1024, sizeof(char));
|
char *buffer = (char *)calloc(1024, sizeof(char));
|
||||||
|
|
||||||
|
@ -39,13 +40,17 @@ main(int argc, char **argv)
|
||||||
if(sakisafeclirc_env == NULL) {
|
if(sakisafeclirc_env == NULL) {
|
||||||
snprintf(config_location, 512, "%s/.sakisafeclirc", getenv("HOME"));
|
snprintf(config_location, 512, "%s/.sakisafeclirc", getenv("HOME"));
|
||||||
FILE *fp = fopen(config_location, "r");
|
FILE *fp = fopen(config_location, "r");
|
||||||
if(fp != NULL)
|
if(fp != NULL) {
|
||||||
parse_config_file(fp);
|
parse_config_file(fp);
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
strncpy(config_location, sakisafeclirc_env, 512);
|
strncpy(config_location, sakisafeclirc_env, 512);
|
||||||
FILE *fp = fopen(config_location, "r");
|
FILE *fp = fopen(config_location, "r");
|
||||||
if(fp != NULL)
|
if(fp != NULL) {
|
||||||
parse_config_file(fp);
|
parse_config_file(fp);
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CURL *easy_handle = curl_easy_init();
|
CURL *easy_handle = curl_easy_init();
|
||||||
|
@ -160,11 +165,17 @@ main(int argc, char **argv)
|
||||||
/* TODO: make it iterate on args so you can upload multiple files
|
/* TODO: make it iterate on args so you can upload multiple files
|
||||||
* at once (sakisafecli file1 file2 ... filen)
|
* at once (sakisafecli file1 file2 ... filen)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if(strstr(server, "concealed.world")) {
|
||||||
|
form_key = "upload";
|
||||||
|
}
|
||||||
|
puts(form_key);
|
||||||
|
|
||||||
for(int i = optind; i < argc; i++) {
|
for(int i = optind; i < argc; i++) {
|
||||||
curl_formadd(&post,
|
curl_formadd(&post,
|
||||||
&last,
|
&last,
|
||||||
CURLFORM_COPYNAME,
|
CURLFORM_COPYNAME,
|
||||||
"file",
|
form_key,
|
||||||
CURLFORM_FILE,
|
CURLFORM_FILE,
|
||||||
argv[i],
|
argv[i],
|
||||||
CURLFORM_END);
|
CURLFORM_END);
|
||||||
|
@ -172,7 +183,7 @@ main(int argc, char **argv)
|
||||||
curl_formadd(&post,
|
curl_formadd(&post,
|
||||||
&last,
|
&last,
|
||||||
CURLFORM_COPYNAME,
|
CURLFORM_COPYNAME,
|
||||||
"file",
|
form_key,
|
||||||
CURLFORM_COPYCONTENTS,
|
CURLFORM_COPYCONTENTS,
|
||||||
argv[i],
|
argv[i],
|
||||||
CURLFORM_END);
|
CURLFORM_END);
|
||||||
|
|
Loading…
Add table
Reference in a new issue