提交 e8e72dd3 authored 作者: Michael Jerris's avatar Michael Jerris

cleanup

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10961 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4bfb1535
......@@ -18,7 +18,6 @@
#include <getopt.h>
static char prompt_str[512] = "";
static char hostname[512] = "";
#ifdef HAVE_EDITLINE
static char *prompt(EditLine * e)
......@@ -236,9 +235,9 @@ int main(int argc, char *argv[])
char cfile[512] = "/tmp/fs_cli_config";
char *home = getenv("HOME");
#else
char hfile[512] = ".\\fs_cli_history";
char cfile[512] = ".\\fs_cli_config";
char *home = ""; //getenv("HOME");
char hfile[512] = "fs_cli_history";
char cfile[512] = "fs_cli_config";
char *home = getenv("HOME");
#endif
/* Vars for optargs */
int opt;
......@@ -276,7 +275,6 @@ int main(int argc, char *argv[])
}
signal(SIGINT, handle_SIGINT);
gethostname(hostname, sizeof(hostname));
handle.debug = 0;
esl_global_set_default_logger(0); /* default debug level to 0 */
......@@ -381,12 +379,14 @@ int main(int argc, char *argv[])
}
}
esl_log(ESL_LOG_INFO, "Using profile %s\n", profile->name);
gethostname(hostname, sizeof(hostname));
snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->name);
esl_log(ESL_LOG_INFO, "Using profile %s [%s]\n", profile->name, profile->host);
if (argv_host) {
snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->host);
} else {
snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", profile->name);
}
if (esl_connect(&handle, profile->host, profile->port, profile->pass)) {
esl_log(ESL_LOG_ERROR, "Error Connecting [%s]\n", handle.err);
return -1;
......
......@@ -634,7 +634,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event_timed(esl_handle_t *handle, uint32_t ms
done:
esl_mutex_unlock(handle->mutex);
if (handle->mutex) esl_mutex_unlock(handle->mutex);
return status;
......
......@@ -313,41 +313,41 @@ static esl_status_t esl_event_base_add_header(esl_event_t *event, esl_stack_t st
int vasprintf(char **ret, const char *format, va_list ap);
static int esl_vasprintf(char **ret, const char *fmt, va_list ap)
{
#ifndef WIN32
return vasprintf(ret, fmt, ap);
#else
char *buf;
int len;
size_t buflen;
va_list ap2;
char *tmp = NULL;
#ifdef _MSC_VER
#if _MSC_VER >= 1500
/* hack for incorrect assumption in msvc header files for code analysis */
__analysis_assume(tmp);
#endif
ap2 = ap;
#else
va_copy(ap2, ap);
#endif
len = vsnprintf(tmp, 0, fmt, ap2);
if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
len = vsnprintf(buf, buflen, fmt, ap);
*ret = buf;
} else {
*ret = NULL;
len = -1;
}
va_end(ap2);
return len;
#endif
}
static int esl_vasprintf(char **ret, const char *fmt, va_list ap)
{
#ifndef WIN32
return vasprintf(ret, fmt, ap);
#else
char *buf;
int len;
size_t buflen;
va_list ap2;
char *tmp = NULL;
#ifdef _MSC_VER
#if _MSC_VER >= 1500
/* hack for incorrect assumption in msvc header files for code analysis */
__analysis_assume(tmp);
#endif
ap2 = ap;
#else
va_copy(ap2, ap);
#endif
len = vsnprintf(tmp, 0, fmt, ap2);
if (len > 0 && (buf = malloc((buflen = (size_t) (len + 1)))) != NULL) {
len = vsnprintf(buf, buflen, fmt, ap);
*ret = buf;
} else {
*ret = NULL;
len = -1;
}
va_end(ap2);
return len;
#endif
}
ESL_DECLARE(esl_status_t) esl_event_add_header(esl_event_t *event, esl_stack_t stack, const char *header_name, const char *fmt, ...)
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论