Inform external download about used proxy.
authorDaniel Carl <danielcarl@gmx.de>
Sun, 29 Jun 2014 13:52:47 +0000 (15:52 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 29 Jun 2014 13:52:47 +0000 (15:52 +0200)
doc/vimb.1
src/main.c

index 82309e3..4d82b89 100644 (file)
@@ -799,6 +799,11 @@ Holds the user agent string that vimb uses.
 The mime-type of the download. This variable is only available when der server
 sent the mime-type header with the response and only if the download was not
 start by the `:save' command or the `;s' hinting.
+.TP
+.B $VIMB_USE_PROXY
+Indicates if the proxy is enabled in vimb. If enable this variable is `1',
+otherwise `0'. Note that this variable gives no hint if the proxy settings
+apply to the URL to be downloaded, only if proxy is enabled in general.
 .PD
 .P
 Example: :set download-command=/bin/sh -c "wget -c %s -O $VIMB_FILE
index 1d8c6aa..bb148bf 100644 (file)
@@ -1284,6 +1284,7 @@ void vb_download_external(WebKitWebView *view, WebKitDownload *download, const c
     /* set the required download information as environment */
     envp = g_get_environ();
     envp = g_environ_setenv(envp, "VIMB_FILE", file, true);
+    envp = g_environ_setenv(envp, "VIMB_USE_PROXY", GET_BOOL("proxy") ? "1" : "0", true);
 #ifdef FEATURE_COOKIE
     envp = g_environ_setenv(envp, "VIMB_COOKIES", vb.files[FILES_COOKIE], true);
 #endif