提交 59f80c9e authored 作者: Travis Cross's avatar Travis Cross

Handle bodies not ending in newlines w/EL_REFRESH

The issue is that sofia siptrace output doesn't end each line with a
newline.  Instead it sends a separate newline afterward, which comes
in as a separate event body.  With the new EL_REFRESH code in effect
the line is being cleared after the siptrace output has been written
but before that next newline comes in.

With our own refresh code this doesn't happen because of slight
differences in where the stdio buffers get flushed compared to where
the output of clear_line() ends up.

This is a bit of a clumsy workaround.  But we'll fix it first, then
refactor.
上级 3bc51dff
......@@ -775,7 +775,19 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
if (global_profile->log_uuid && !esl_strlen_zero(userdata)) {
printf("%s ", userdata);
}
#if HAVE_DECL_EL_REFRESH
if (strcmp("\n",handle->last_event->body)) {
char *c = handle->last_event->body;
printf("%s", handle->last_event->body);
if (*c) {
while (*c) ++c; c--;
if (*c != '\n')
printf("\n");
}
}
#else
printf("%s", handle->last_event->body);
#endif
if(!(global_profile->batch_mode)) {
if (!feature_level) printf("%s", ESL_SEQ_DEFAULT_COLOR);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论