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.
This commit is contained in:
Travis Cross 2014-03-27 22:30:33 +00:00
parent 3bc51dfff9
commit 59f80c9e4f
1 changed files with 12 additions and 0 deletions

View File

@ -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);
}