Skip to content

Commit

Permalink
msg: improve show_readable()
Browse files Browse the repository at this point in the history
So that we don't waste resources when nothing is printed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information
felipec committed Feb 7, 2010
1 parent 1ef2e72 commit 2b74408
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/msg.c
Expand Up @@ -710,13 +710,17 @@ void
msn_message_show_readable(MsnMessage *msg, const char *info,
gboolean text_body)
{
#if defined(PN_DEBUG)
GString *str;
size_t body_len;
const char *body;
GList *l;

g_return_if_fail(msg != NULL);

if (PECAN_LOG_LEVEL < PN_LOG_LEVEL_DEBUG)
return;

str = g_string_new(NULL);

/* Standard header. */
Expand Down Expand Up @@ -803,4 +807,5 @@ msn_message_show_readable(MsnMessage *msg, const char *info,
pn_debug ("info=[%s],str=[%s]", info, str->str);

g_string_free(str, TRUE);
#endif /* PN_DEBUG */
}

0 comments on commit 2b74408

Please sign in to comment.