edup = strdup(events);
+ switch_assert(edup);
+
if (strchr(edup, ' ')) {
delim = ' ';
}
val++;
}
}
- if (var && val) {
+ if (val) {
switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, var, val);
if (!strcasecmp(var, "content-length")) {
clen = atoi(val);
switch_safe_free(stream.data);
switch_safe_free(freply);
- if (acs->listener->rwlock) {
- switch_thread_rwlock_unlock(acs->listener->rwlock);
- }
+ switch_thread_rwlock_unlock(acs->listener->rwlock);
done:
if (arg) {
switch_safe_free(dup_arg);
dup_arg = strdup(arg);
+ switch_assert(dup_arg);
check_cmd = dup_arg;
if ((next = strchr(check_cmd, ' '))) {
*next++ = '\0';
user = cmd + 9;
- if (user && (domain_name = strchr(user, '@'))) {
+ if ((domain_name = strchr(user, '@'))) {
*domain_name++ = '\0';
}
edup = strdup(allowed_events);
cur = edup;
+ switch_assert(edup);
+
if (strchr(edup, ' ')) {
delim = ' ';
}
bot:
-
- if (params) {
- switch_event_destroy(¶ms);
- }
+ switch_event_destroy(¶ms);
if (authed) {
switch_set_flag_locked(listener, LFLAG_AUTHED);
channel = switch_core_session_get_channel(listener->session);
- if (onoff) {
- while (*onoff == ' ') {
- onoff++;
- }
+ while (*onoff == ' ') {
+ onoff++;
+ }
- if (*onoff == '\r' || *onoff == '\n') {
- onoff = NULL;
- } else {
- strip_cr(onoff);
- }
+ if (*onoff == '\r' || *onoff == '\n') {
+ onoff = NULL;
+ } else {
+ strip_cr(onoff);
}
if (zstr(onoff)) {
async = 1;
}
- if (uuid) {
- while (*uuid == ' ') {
- uuid++;
- }
+ while (*uuid == ' ') {
+ uuid++;
+ }
- if (*uuid == '\r' || *uuid == '\n') {
- uuid = NULL;
- } else {
- strip_cr(uuid);
- }
+ if (*uuid == '\r' || *uuid == '\n') {
+ uuid = NULL;
+ } else {
+ strip_cr(uuid);
}
if (zstr(uuid)) {
char *arg_copy = NULL;
int ok = 0;
+ switch_assert(api_copy);
+
if ((arg_copy = strchr(api_copy, ' '))) {
*arg_copy++ = '\0';
}
acs->listener = listener;
acs->console_execute = 0;
- if (api_cmd) {
- acs->api_cmd = switch_core_strdup(acs->pool, api_cmd);
- }
+ acs->api_cmd = switch_core_strdup(acs->pool, api_cmd);
if (arg) {
acs->arg = switch_core_strdup(acs->pool, arg);
}
strip_cr(cmd);
cur = cmd + 5;
- if (cur && (cur = strchr(cur, ' '))) {
+ if ((cur = strchr(cur, ' '))) {
for (cur++; cur; count++) {
switch_event_types_t type;
strip_cr(cmd);
cur = cmd + 8;
- if (cur && (cur = strchr(cur, ' '))) {
+ if ((cur = strchr(cur, ' '))) {
for (cur++; cur; count++) {
switch_event_types_t type;
if (switch_socket_addr_get(&listener->sa, SWITCH_TRUE, listener->sock) == SWITCH_STATUS_SUCCESS && listener->sa) {
switch_get_addr(listener->remote_ip, sizeof(listener->remote_ip), listener->sa);
- if (listener->sa && (listener->remote_port = switch_sockaddr_get_port(listener->sa))) {
+ if ((listener->remote_port = switch_sockaddr_get_port(listener->sa))) {
launch_listener_thread(listener);
continue;
}