Loading src/imlib.c +16 −2 Original line number Diff line number Diff line Loading @@ -258,9 +258,12 @@ int feh_load_image(Imlib_Image * im, feh_file * file) file->ed = exif_get_data(tmpname); #endif } if ((image_source != SRC_HTTP) || !opt.keep_http) if ((image_source != SRC_HTTP) || (!opt.keep_http && !opt.use_http_cache)) unlink(tmpname); else if (opt.use_http_cache && !opt.keep_http) add_file_to_rm_filelist(tmpname); if (image_source != SRC_HTTP && !opt.use_http_cache) free(tmpname); } Loading Loading @@ -542,6 +545,8 @@ static char *feh_magick_load_image(char *filename) #ifdef HAVE_LIBCURL gib_hash* http_cache = NULL; #if LIBCURL_VERSION_NUM >= 0x072000 /* 07.32.0 */ static int curl_quit_function(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) #else Loading Loading @@ -576,6 +581,13 @@ static char *feh_http_load_image(char *url) char *basename; char *path = NULL; if (opt.use_http_cache) { if (!http_cache) http_cache = gib_hash_new(); if ((sfn = gib_hash_get(http_cache, url)) != NULL) return sfn; } if (opt.keep_http) { if (opt.output_dir) path = opt.output_dir; Loading Loading @@ -648,6 +660,8 @@ static char *feh_http_load_image(char *url) free(ebuff); fclose(sfp); if (opt.use_http_cache) gib_hash_set(http_cache, url, sfn); return sfn; } else { weprintf("open url: fdopen failed:"); Loading src/options.c +4 −0 Original line number Diff line number Diff line Loading @@ -431,6 +431,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"auto-reload" , 0, 0, 248}, #endif {"class" , 1, 0, 249}, {"use-http-cache", 0, 0, 250}, {0, 0, 0, 0} }; int optch = 0, cmdx = 0; Loading Loading @@ -827,6 +828,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) case 249: opt.x11_class = estrdup(optarg); break; case 250: opt.use_http_cache = 1; break; default: break; } Loading src/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ struct __fehoptions { unsigned char aspect; unsigned char stretch; unsigned char keep_http; unsigned char use_http_cache; unsigned char borderless; unsigned char randomize; unsigned char jump_on_resort; Loading Loading
src/imlib.c +16 −2 Original line number Diff line number Diff line Loading @@ -258,9 +258,12 @@ int feh_load_image(Imlib_Image * im, feh_file * file) file->ed = exif_get_data(tmpname); #endif } if ((image_source != SRC_HTTP) || !opt.keep_http) if ((image_source != SRC_HTTP) || (!opt.keep_http && !opt.use_http_cache)) unlink(tmpname); else if (opt.use_http_cache && !opt.keep_http) add_file_to_rm_filelist(tmpname); if (image_source != SRC_HTTP && !opt.use_http_cache) free(tmpname); } Loading Loading @@ -542,6 +545,8 @@ static char *feh_magick_load_image(char *filename) #ifdef HAVE_LIBCURL gib_hash* http_cache = NULL; #if LIBCURL_VERSION_NUM >= 0x072000 /* 07.32.0 */ static int curl_quit_function(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) #else Loading Loading @@ -576,6 +581,13 @@ static char *feh_http_load_image(char *url) char *basename; char *path = NULL; if (opt.use_http_cache) { if (!http_cache) http_cache = gib_hash_new(); if ((sfn = gib_hash_get(http_cache, url)) != NULL) return sfn; } if (opt.keep_http) { if (opt.output_dir) path = opt.output_dir; Loading Loading @@ -648,6 +660,8 @@ static char *feh_http_load_image(char *url) free(ebuff); fclose(sfp); if (opt.use_http_cache) gib_hash_set(http_cache, url, sfn); return sfn; } else { weprintf("open url: fdopen failed:"); Loading
src/options.c +4 −0 Original line number Diff line number Diff line Loading @@ -431,6 +431,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"auto-reload" , 0, 0, 248}, #endif {"class" , 1, 0, 249}, {"use-http-cache", 0, 0, 250}, {0, 0, 0, 0} }; int optch = 0, cmdx = 0; Loading Loading @@ -827,6 +828,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) case 249: opt.x11_class = estrdup(optarg); break; case 250: opt.use_http_cache = 1; break; default: break; } Loading
src/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ struct __fehoptions { unsigned char aspect; unsigned char stretch; unsigned char keep_http; unsigned char use_http_cache; unsigned char borderless; unsigned char randomize; unsigned char jump_on_resort; Loading