summaryrefslogtreecommitdiff
path: root/plugin/feedback/feedback.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2015-10-05 14:46:12 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2015-10-09 03:23:35 +0500
commit3757bc5e895289a6d69e6382bccb11c021e7144c (patch)
treec62c4b29573a26d4b58245e21bc85d8e97523f00 /plugin/feedback/feedback.cc
parent16ad1fc54027c4607f9edd14b02f776b41393f16 (diff)
downloadmariadb-git-3757bc5e895289a6d69e6382bccb11c021e7144c.tar.gz
MDEV-8431 Feedback plugin needs an option for http proxy.
'feedback_http_proxy' system variable added to specify the proxy server as host:port. Not a dynamic one.
Diffstat (limited to 'plugin/feedback/feedback.cc')
-rw-r--r--plugin/feedback/feedback.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index 053d68eb66d..e0c8738eae3 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -25,7 +25,7 @@ namespace feedback {
char server_uid_buf[SERVER_UID_SIZE+1]; ///< server uid will be written here
/* backing store for system variables */
-static char *server_uid= server_uid_buf, *url;
+static char *server_uid= server_uid_buf, *url, *http_proxy;
char *user_info;
ulong send_timeout, send_retry_wait;
@@ -272,7 +272,13 @@ static int init(void *p)
if (*e == 0 || *e == ' ')
{
if (e > s && (urls[slot]= Url::create(s, e - s)))
+ {
+ if (urls[slot]->set_proxy(http_proxy,
+ http_proxy ? strlen(http_proxy) : 0))
+ sql_print_error("feedback plugin: invalid proxy '%s'",
+ http_proxy ? http_proxy : "");
slot++;
+ }
else
{
if (e > s)
@@ -350,6 +356,10 @@ static MYSQL_SYSVAR_ULONG(send_timeout, send_timeout, PLUGIN_VAR_RQCMDARG,
static MYSQL_SYSVAR_ULONG(send_retry_wait, send_retry_wait, PLUGIN_VAR_RQCMDARG,
"Wait this many seconds before retrying a failed send.",
NULL, NULL, 60, 1, 60*60*24, 1);
+static MYSQL_SYSVAR_STR(http_proxy, http_proxy,
+ PLUGIN_VAR_READONLY | PLUGIN_VAR_RQCMDARG,
+ "Proxy server host:port.", NULL, NULL,0);
+
static struct st_mysql_sys_var* settings[] = {
MYSQL_SYSVAR(server_uid),
@@ -357,6 +367,7 @@ static struct st_mysql_sys_var* settings[] = {
MYSQL_SYSVAR(url),
MYSQL_SYSVAR(send_timeout),
MYSQL_SYSVAR(send_retry_wait),
+ MYSQL_SYSVAR(http_proxy),
NULL
};