Index: opensync/ipc/opensync_queue_internals.h
===================================================================
--- opensync/ipc/opensync_queue_internals.h	(revision 5965)
+++ opensync/ipc/opensync_queue_internals.h	(working copy)
@@ -90,20 +90,6 @@
 OSYNC_TEST_EXPORT void osync_queue_set_message_handler(OSyncQueue *queue, OSyncMessageHandler handler, gpointer user_data);
 
 /**
- * @brief Cross links command queue and reply queue
- * 
- * Stores the queue used for replies in the command queue object so
- * that timeout responses can be sent if necessary.
- * And stores the command queue in the reply queue object so that
- * replies can remove pending messages before they time out.
- * 
- * @param cmd_queue The command queue used to receive incoming commands
- * @param reply_queue The queue used to send replies 
- * 
- */
-OSYNC_TEST_EXPORT void osync_queue_cross_link(OSyncQueue *cmd_queue, OSyncQueue *reply_queue);
-
-/**
  * @brief Remove cross links between command queues and reply queues
  * 
  * Removes the cross-links from this queue and all queues linked
Index: opensync/ipc/opensync_queue.h
===================================================================
--- opensync/ipc/opensync_queue.h	(revision 5965)
+++ opensync/ipc/opensync_queue.h	(working copy)
@@ -120,6 +120,20 @@
  */
 OSYNC_EXPORT osync_bool osync_queue_disconnect(OSyncQueue *queue, OSyncError **error);
 
+/**
+ * @brief Cross links command queue and reply queue
+ * 
+ * Stores the queue used for replies in the command queue object so
+ * that timeout responses can be sent if necessary.
+ * And stores the command queue in the reply queue object so that
+ * replies can remove pending messages before they time out.
+ * 
+ * @param cmd_queue The command queue used to receive incoming commands
+ * @param reply_queue The queue used to send replies 
+ * 
+ */
+OSYNC_EXPORT void osync_queue_cross_link(OSyncQueue *cmd_queue, OSyncQueue *reply_queue);
+
 /*@}*/
 #endif /* _OPENSYNC_QUEUE_H */
 
Index: opensync/client/osplugin.c
===================================================================
--- opensync/client/osplugin.c	(revision 5965)
+++ opensync/client/osplugin.c	(working copy)
@@ -22,7 +22,9 @@
 #include "opensync_internals.h"
 
 #include "opensync-ipc.h"
+
 #include "opensync-client.h"
+#include "opensync_client_internals.h"
 
 static void usage (int ecode)
 {
@@ -99,10 +101,12 @@
 		if (!osync_client_set_incoming_queue(client, incoming, &error))
 			goto error;
 
-		osync_queue_unref(incoming);
 		if (!osync_client_set_outgoing_queue(client, outgoing, &error))
 			goto error;
 
+		osync_queue_cross_link(incoming, outgoing);
+
+		osync_queue_unref(incoming);
 		osync_queue_unref(outgoing);
 	} else {
 		/* Create connection pipes **/
Index: opensync.sym
===================================================================
--- opensync.sym	(revision 5965)
+++ opensync.sym	(working copy)
@@ -654,6 +654,7 @@
 osync_plugin_unref
 osync_queue_connect
 osync_queue_create
+osync_queue_cross_link
 osync_queue_disconnect
 osync_queue_new
 osync_queue_new_from_fd

