int use_dynamic_url;
long auth_scheme;
int timeout;
+ switch_size_t curl_max_bytes;
};
static int keep_files_around = 0;
memset(&config_data, 0, sizeof(config_data));
config_data.name = filename;
- config_data.max_bytes = XML_CURL_MAX_BYTES;
+ config_data.max_bytes = binding->curl_max_bytes;
if ((config_data.fd = open(filename, O_CREAT | O_RDWR | O_TRUNC, S_IRUSR | S_IWUSR)) > -1) {
if (!zstr(binding->cred)) {
char *method = NULL;
int disable100continue = 1;
int use_dynamic_url = 0, timeout = 0;
+ switch_size_t curl_max_bytes = XML_CURL_MAX_BYTES;
uint32_t enable_cacert_check = 0;
char *ssl_cert_file = NULL;
char *ssl_key_file = NULL;
}
} else if (!strcasecmp(var, "bind-local")) {
bind_local = val;
+ } else if (!strcasecmp(var, "response-max-bytes")) {
+ int tmp = atoi(val);
+ if (tmp >= 0) {
+ curl_max_bytes = tmp;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't set a negative maximum response bytes!\n");
+ }
}
}
}
+ binding->curl_max_bytes = curl_max_bytes;
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Binding [%s] XML Fetch Function [%s] [%s]\n",
zstr(bname) ? "N/A" : bname, binding->url, binding->bindings ? binding->bindings : "all");
switch_xml_bind_search_function(xml_url_fetch, switch_xml_parse_section_string(binding->bindings), binding);