forked from Mirrors/freeswitch
if plus a space
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9855 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
16b65a8f22
commit
d0688264c6
@ -247,7 +247,7 @@ SWITCH_STANDARD_API(eval_function)
|
||||
SWITCH_STANDARD_API(module_exists_function)
|
||||
{
|
||||
if (!switch_strlen_zero(cmd)) {
|
||||
if(switch_loadable_module_exists(cmd) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_loadable_module_exists(cmd) == SWITCH_STATUS_SUCCESS) {
|
||||
stream->write_function(stream, "true");
|
||||
} else {
|
||||
stream->write_function(stream, "false");
|
||||
|
@ -2231,7 +2231,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile,
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_file_path", file_path);
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_read_flags", read_flags);
|
||||
|
||||
if(!switch_strlen_zero(vm_timezone)) {
|
||||
if (!switch_strlen_zero(vm_timezone)) {
|
||||
char tz_date[80] = "";
|
||||
if ((switch_strftime_tz(vm_timezone, profile->date_fmt, tz_date, sizeof(tz_date)) == SWITCH_STATUS_SUCCESS) && !switch_strlen_zero_buf(tz_date)) {
|
||||
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", tz_date);
|
||||
|
@ -266,7 +266,7 @@ static mrcp_status_t openmrcp_recog_start(mrcp_client_context_t *context, openmr
|
||||
|
||||
recognizer_header = mrcp_resource_header_prepare(mrcp_message);
|
||||
|
||||
if(!recognizer_header) {
|
||||
if (!recognizer_header) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not prepare resource_header\n");
|
||||
return MRCP_STATUS_FAILURE;
|
||||
}
|
||||
|
@ -616,6 +616,7 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, const char
|
||||
mpg123_param(context->mh, MPG123_FLAGS, MPG123_SEEKBUFFER|MPG123_MONO_MIX, 0);
|
||||
context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path);
|
||||
context->prebuf = handle->prebuf;
|
||||
handle->vol = -4;
|
||||
launch_read_stream_thread(context);
|
||||
} else {
|
||||
mpg123_param(context->mh, MPG123_FLAGS, MPG123_MONO_MIX, 0);
|
||||
|
@ -99,7 +99,7 @@ static switch_status_t mod_syslog_logger(const switch_log_node_t *node, switch_l
|
||||
}
|
||||
|
||||
/* don't log blank lines */
|
||||
if(!switch_strlen_zero(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) {
|
||||
if (!switch_strlen_zero(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) {
|
||||
syslog(syslog_level, "%s", node->data);
|
||||
}
|
||||
|
||||
@ -128,8 +128,7 @@ static switch_status_t load_config(void)
|
||||
set_global_format(val);
|
||||
} else if (!strcasecmp(var, "loglevel") && !switch_strlen_zero(val)) {
|
||||
log_level = switch_log_str2level(val);
|
||||
if(log_level == SWITCH_LOG_INVALID)
|
||||
{
|
||||
if (log_level == SWITCH_LOG_INVALID) {
|
||||
log_level = SWITCH_LOG_WARNING;
|
||||
}
|
||||
}
|
||||
|
@ -306,12 +306,12 @@ static switch_status_t do_config(void)
|
||||
|
||||
binding->vars_map = vars_map;
|
||||
|
||||
if(vars_map) {
|
||||
if (vars_map) {
|
||||
switch_zmalloc(hash_node,sizeof(hash_node_t));
|
||||
hash_node->hash = vars_map;
|
||||
hash_node->next = NULL;
|
||||
|
||||
if(!globals.hash_root) {
|
||||
if (!globals.hash_root) {
|
||||
globals.hash_root = hash_node;
|
||||
globals.hash_tail = globals.hash_root;
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ static switch_xml_t xml_ldap_search(const char *section, const char *tag_name, c
|
||||
//switch_xml_toxml_buf(xml,buf,0,0,1);
|
||||
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "providing:\n%s\n", buf);
|
||||
|
||||
if(ret) {
|
||||
if (ret) {
|
||||
switch_xml_free(xml);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -131,7 +131,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_c
|
||||
while (alloc->track[index] && tries < alloc->track_len)
|
||||
{
|
||||
tries++;
|
||||
if(++index >= alloc->track_len) index = 0;
|
||||
if (++index >= alloc->track_len) {
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (tries < alloc->track_len) {
|
||||
|
@ -538,8 +538,7 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
|
||||
switch (attr->type) {
|
||||
case SWITCH_STUN_ATTR_MAPPED_ADDRESS:
|
||||
if (attr->type) {
|
||||
if(funny)
|
||||
{
|
||||
if (funny) {
|
||||
((switch_stun_ip_t *) attr->value)->address ^= ntohl(0xabcdabcd);
|
||||
}
|
||||
switch_stun_packet_attribute_get_mapped_address(attr, rip, &rport);
|
||||
|
@ -1082,7 +1082,7 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i
|
||||
pattern = full_path;
|
||||
}
|
||||
|
||||
if(glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) {
|
||||
if (glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) {
|
||||
if (stderr) {
|
||||
fprintf(stderr, "Error including %s\n", pattern);
|
||||
}
|
||||
@ -1154,7 +1154,7 @@ static int preprocess(const char *cwd, const char *file, int write_fd, int rleve
|
||||
if ((e = strstr(tcmd, "/>"))) {
|
||||
*e += 2;
|
||||
*e = '\0';
|
||||
if(write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) {
|
||||
if (write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n");
|
||||
}
|
||||
}
|
||||
@ -1223,13 +1223,13 @@ static int preprocess(const char *cwd, const char *file, int write_fd, int rleve
|
||||
}
|
||||
|
||||
if ((cmd = strstr(bp, "<!--#"))) {
|
||||
if(write(write_fd, bp, (unsigned) (cmd - bp)) != (cmd - bp)) {
|
||||
if (write(write_fd, bp, (unsigned) (cmd - bp)) != (cmd - bp)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n");
|
||||
}
|
||||
if ((e = strstr(cmd, "-->"))) {
|
||||
*e = '\0';
|
||||
e += 3;
|
||||
if(write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) {
|
||||
if (write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n");
|
||||
}
|
||||
} else {
|
||||
@ -1279,7 +1279,7 @@ static int preprocess(const char *cwd, const char *file, int write_fd, int rleve
|
||||
continue;
|
||||
}
|
||||
|
||||
if(write(write_fd, bp, (unsigned) cur) != (int) cur) {
|
||||
if (write(write_fd, bp, (unsigned) cur) != (int) cur) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n");
|
||||
}
|
||||
}
|
||||
@ -2490,7 +2490,7 @@ static int glob3(char *pathbuf, char *pathend, char *pathend_last, char *pattern
|
||||
*pathend = EOS;
|
||||
errno = 0;
|
||||
|
||||
if(apr_dir_open (&dirp, pathbuf, pool) != APR_SUCCESS) {
|
||||
if (apr_dir_open (&dirp, pathbuf, pool) != APR_SUCCESS) {
|
||||
/* TODO: don't call for ENOENT or ENOTDIR? */
|
||||
apr_pool_destroy(pool);
|
||||
if (pglob->gl_errfunc) {
|
||||
@ -2510,9 +2510,9 @@ static int glob3(char *pathbuf, char *pathend, char *pathend_last, char *pattern
|
||||
unsigned char *sc;
|
||||
char *dc;
|
||||
|
||||
if(apr_dir_read(&dp, APR_FINFO_NAME, dirp) != APR_SUCCESS)
|
||||
if (apr_dir_read(&dp, APR_FINFO_NAME, dirp) != APR_SUCCESS)
|
||||
break;
|
||||
if(!(dp.valid & APR_FINFO_NAME) || !(dp.name) || !strlen(dp.name))
|
||||
if (!(dp.valid & APR_FINFO_NAME) || !(dp.name) || !strlen(dp.name))
|
||||
break;
|
||||
|
||||
/* Initial DOT must be matched literally. */
|
||||
@ -2533,7 +2533,7 @@ static int glob3(char *pathbuf, char *pathend, char *pathend_last, char *pattern
|
||||
break;
|
||||
}
|
||||
|
||||
if(dirp)
|
||||
if (dirp)
|
||||
apr_dir_close (dirp);
|
||||
apr_pool_destroy(pool);
|
||||
return(err);
|
||||
|
Loading…
Reference in New Issue
Block a user