Factored out connection_log_send from connection_send
authorMikael Hallendal <micke@imendio.com>
Wed, 18 Jun 2008 22:27:47 +0200
changeset 406 3c6b13d37d41
parent 405 f33dcdadf95c
child 407 4401f2aa0692
Factored out connection_log_send from connection_send
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 */