<p>Holger Hans Peter Freyther has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19659">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_http_media_cache: Allow to specify the proxy<br><br>https://curl.se/libcurl/c/CURLOPT_PROXY.html<br><br>ASTERISK-30340<br><br>Change-Id: Ife7399f5da9b76937294800f52875125b77e1710<br>---<br>M res/res_http_media_cache.c<br>1 file changed, 25 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/19659/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_http_media_cache.c b/res/res_http_media_cache.c</span><br><span>index bef3750..7528aac 100644</span><br><span>--- a/res/res_http_media_cache.c</span><br><span>+++ b/res/res_http_media_cache.c</span><br><span>@@ -49,6 +49,9 @@</span><br><span> <configOption name="maxrdirects"></span><br><span> <synopsis>The maximum number of redirects to follow. See https://curl.se/libcurl/c/CURLOPT_MAXREDIRS.html for details</synopsis></span><br><span> </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+ <configOption name="proxy"></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>The proxy to use for requests. See https://curl.se/libcurl/c/CURLOPT_PROXY.html for details.</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ </configOption></span><br><span> </configObject></span><br><span> </configFile></span><br><span> </configInfo></span><br><span>@@ -71,6 +74,7 @@</span><br><span> static char *cache_curl_useragent = NULL;</span><br><span> static int cache_followlocation = 1;</span><br><span> static int cache_maxredirs = 8;</span><br><span style="color: hsl(120, 100%, 40%);">+static char *cache_curl_proxy = NULL;</span><br><span> </span><br><span> </span><br><span> </span><br><span>@@ -362,6 +366,7 @@</span><br><span> curl_easy_setopt(curl, CURLOPT_MAXREDIRS, cache_maxredirs);</span><br><span> curl_easy_setopt(curl, CURLOPT_URL, ast_sorcery_object_get_id(cb_data->bucket_file));</span><br><span> curl_easy_setopt(curl, CURLOPT_HEADERDATA, cb_data);</span><br><span style="color: hsl(120, 100%, 40%);">+ curl_easy_setopt(curl, CURLOPT_PROXY, cache_curl_proxy);</span><br><span> </span><br><span> return curl;</span><br><span> }</span><br><span>@@ -600,6 +605,13 @@</span><br><span> cache_followlocation = ast_true(var->value);</span><br><span> } else if (strcasecmp(var->name, "maxredirects") == 0) {</span><br><span> cache_maxredirs = strtoul(var->value, NULL, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (strcasecmp(var->name, "proxy") == 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(cache_curl_proxy);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (strlen(var->value) > 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ cache_curl_proxy = ast_strdup(var->value);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ cache_curl_proxy = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> } else {</span><br><span> ast_log(LOG_ERROR, "Unrecognized variable '%s' in category '%s'\n", var->name, cat);</span><br><span> ast_config_destroy(cfg);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19659">change 19659</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19659"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: Ife7399f5da9b76937294800f52875125b77e1710 </div>
<div style="display:none"> Gerrit-Change-Number: 19659 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Holger Hans Peter Freyther <automatic@freyther.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>