# HG changeset patch # User Mikael Hallendal # Date 1213820867 -7200 # Node ID 3c6b13d37d41f8f6291fa373791b5e011c10a7e6 # Parent f33dcdadf95ca7b798ae9e3d0bdbe940ea3112b0 Factored out connection_log_send from connection_send diff -r f33dcdadf95c -r 3c6b13d37d41 loudmouth/lm-connection.c --- a/loudmouth/lm-connection.c Wed Jun 18 22:27:40 2008 +0200 +++ b/loudmouth/lm-connection.c Wed Jun 18 22:27:47 2008 +0200 @@ -377,6 +377,19 @@ connection->keep_alive_source = NULL; } +static void +connection_log_send (LmConnection *connection, + const gchar *str, + gint len) +{ + g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "\nSEND:\n"); + g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, + "-----------------------------------\n"); + g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "%s\n", str); + g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, + "-----------------------------------\n"); +} + static gboolean connection_send (LmConnection *connection, const gchar *str, @@ -400,12 +413,7 @@ len = strlen (str); } - g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "\nSEND:\n"); - g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, - "-----------------------------------\n"); - g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "%s\n", str); - g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, - "-----------------------------------\n"); + connection_log_send (connection, str, len); /* Check to see if there already is an output buffer, if so, add to the buffer and return */