git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7424 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-01-29 19:01:35 +00:00
parent 4a51128f42
commit 92f722b535
1 changed files with 8 additions and 12 deletions

View File

@ -469,11 +469,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_set_priority(switch_event_t *event,
SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *header_name)
{
switch_event_header_t *hp;
if (header_name) {
for (hp = event->headers; hp; hp = hp->next) {
if (!strcasecmp(hp->name, header_name)) {
return hp->value;
}
if (!header_name) return NULL;
for (hp = event->headers; hp; hp = hp->next) {
if (!strcasecmp(hp->name, header_name)) {
return hp->value;
}
}
return NULL;
@ -481,11 +481,7 @@ SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *head
SWITCH_DECLARE(char *) switch_event_get_body(switch_event_t *event)
{
if (event) {
return event->body;
}
return NULL;
return (event ? event->body : NULL);
}
SWITCH_DECLARE(switch_status_t) switch_event_del_header(switch_event_t *event, const char *header_name)
@ -792,9 +788,9 @@ SWITCH_DECLARE(switch_status_t) switch_event_serialize(switch_event_t *event, ch
static switch_xml_t add_xml_header(switch_xml_t xml, char *name, char *value, int offset)
{
switch_xml_t header = NULL;
switch_xml_t header = switch_xml_add_child_d(xml, "header", offset);
if ((header = switch_xml_add_child_d(xml, "header", offset))) {
if (header) {
switch_xml_set_attr_d(header, "name", name);
switch_xml_set_attr_d(header, "value", value);
}