change xml_lookups to take an event as params instead of url string this will break your xml_curl scripts please update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7334 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-01-23 21:14:38 +00:00
parent 1424b6c73b
commit 591f098a14
2 changed files with 18 additions and 18 deletions

View File

@ -138,9 +138,8 @@ static switch_xml_t xml_url_fetch(const char *section, const char *tag_name, con
switch_str_nil(key_value));
data = switch_event_build_param_string(params, basic_data);
switch_assert(data);
printf("XXXXXXXXXXXXXXXXXXXX\n%s\n", data);
switch_uuid_get(&uuid);
switch_uuid_format(uuid_str, &uuid);

View File

@ -1310,28 +1310,29 @@ SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, co
stream.write_function(&stream, "%s=%s&", prof_names[x], encode_buf);
}
if ((hi = event->headers)) {
for (; hi; hi = hi->next) {
char *var = hi->name;
char *val = hi->value;
if (event) {
if ((hi = event->headers)) {
for (; hi; hi = hi->next) {
char *var = hi->name;
char *val = hi->value;
new_len = (strlen((char *) var) * 3) + 1;
if (encode_len < new_len) {
char *tmp;
new_len = (strlen((char *) var) * 3) + 1;
if (encode_len < new_len) {
char *tmp;
encode_len = new_len;
encode_len = new_len;
tmp = realloc(encode_buf, encode_len);
switch_assert(tmp);
encode_buf = tmp;
tmp = realloc(encode_buf, encode_len);
switch_assert(tmp);
encode_buf = tmp;
}
switch_url_encode((char *) val, encode_buf, encode_len - 1);
stream.write_function(&stream, "%s=%s&", (char *) var, encode_buf);
}
switch_url_encode((char *) val, encode_buf, encode_len - 1);
stream.write_function(&stream, "%s=%s&", (char *) var, encode_buf);
}
}
e = (char *) stream.data + (strlen((char *) stream.data) - 1);
if (e && *e == '&') {