From 91b73d1ff8d39f6156837cdecf205584e111cb6b Mon Sep 17 00:00:00 2001 From: Raymond Chandler Date: Fri, 16 Sep 2011 19:08:30 -0400 Subject: [PATCH] add params so xml curl can know who's calling the directory request --- src/mod/endpoints/mod_rtmp/rtmp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_rtmp/rtmp.c b/src/mod/endpoints/mod_rtmp/rtmp.c index 1db027405c..10a48b3748 100644 --- a/src/mod/endpoints/mod_rtmp/rtmp.c +++ b/src/mod/endpoints/mod_rtmp/rtmp.c @@ -188,9 +188,14 @@ switch_status_t rtmp_check_auth(rtmp_session_t *rsession, const char *user, cons switch_xml_t xml = NULL, x_param, x_params; switch_bool_t allow_empty_password = SWITCH_FALSE; const char *passwd = NULL; + switch_event_t *locate_params; + + switch_event_create(&locate_params, SWITCH_EVENT_GENERAL); + switch_assert(locate_params); + switch_event_add_header_string(locate_params, SWITCH_STACK_BOTTOM, "source", "mod_rtmp"); /* Locate user */ - if (switch_xml_locate_user_merged("id", user, domain, NULL, &xml, NULL) != SWITCH_STATUS_SUCCESS) { + if (switch_xml_locate_user_merged("id", user, domain, NULL, &xml, locate_params) != SWITCH_STATUS_SUCCESS) { switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rsession->uuid), SWITCH_LOG_WARNING, "Authentication failed. No such user %s@%s\n", user, domain); goto done; } @@ -231,6 +236,9 @@ done: if (xml) { switch_xml_free(xml); } + + switch_event_destroy(&locate_params); + return status; }