Ticket #1190: fix_osplugin_plugin_queue.diff

File fix_osplugin_plugin_queue.diff, 3.0 KB (added by prahal, 3 years ago)

One way to fix the cmd_queue not defined when using osplugin instead of thread

  • svn/libopensync/opensync/ipc/opensync_queue_internals.h

     
    101101 * @param reply_queue The queue used to send replies  
    102102 *  
    103103 */ 
    104 OSYNC_TEST_EXPORT void osync_queue_cross_link(OSyncQueue *cmd_queue, OSyncQueue *reply_queue); 
     104//OSYNC_TEST_EXPORT void osync_queue_cross_link(OSyncQueue *cmd_queue, OSyncQueue *reply_queue); 
    105105 
    106106/** 
    107107 * @brief Remove cross links between command queues and reply queues 
     
    112112 * @param queue The queue to unlink 
    113113 *  
    114114 */ 
    115 OSYNC_TEST_EXPORT void osync_queue_remove_cross_link(OSyncQueue *queue); 
     115//OSYNC_TEST_EXPORT void osync_queue_remove_cross_link(OSyncQueue *queue); 
    116116 
    117117/** 
    118118 * @brief Set pending limit on queue 
  • svn/libopensync/opensync/ipc/opensync_queue.h

     
    120120 */ 
    121121OSYNC_EXPORT osync_bool osync_queue_disconnect(OSyncQueue *queue, OSyncError **error); 
    122122 
     123/** 
     124 * @brief Cross links command queue and reply queue 
     125 *  
     126 * Stores the queue used for replies in the command queue object so 
     127 * that timeout responses can be sent if necessary. 
     128 * And stores the command queue in the reply queue object so that 
     129 * replies can remove pending messages before they time out. 
     130 *  
     131 * @param cmd_queue The command queue used to receive incoming commands 
     132 * @param reply_queue The queue used to send replies  
     133 *  
     134 */ 
     135OSYNC_EXPORT void osync_queue_cross_link(OSyncQueue *cmd_queue, OSyncQueue *reply_queue); 
     136 
     137/** 
     138 * @brief Remove cross links between command queues and reply queues 
     139 *  
     140 * Removes the cross-links from this queue and all queues linked 
     141 * from it, recursively 
     142 *  
     143 * @param queue The queue to unlink 
     144 *  
     145 */ 
     146OSYNC_EXPORT void osync_queue_remove_cross_link(OSyncQueue *queue); 
     147 
    123148/*@}*/ 
    124149#endif /* _OPENSYNC_QUEUE_H */ 
    125150 
  • svn/libopensync/opensync/client/osplugin.c

     
    2222#include "opensync_internals.h" 
    2323 
    2424#include "opensync-ipc.h" 
     25 
    2526#include "opensync-client.h" 
     27#include "opensync_client_internals.h" 
     28#include "opensync_client_private.h" 
    2629 
    2730static void usage (int ecode) 
    2831{ 
     
    103106                if (!osync_client_set_outgoing_queue(client, outgoing, &error)) 
    104107                        goto error; 
    105108 
     109                osync_queue_cross_link(client->incoming, client->outgoing); 
    106110                osync_queue_unref(outgoing); 
    107111        } else { 
    108112                /* Create connection pipes **/ 
     
    120124                if (!osync_client_set_incoming_queue(client, incoming, &error)) 
    121125                        goto error; 
    122126 
     127                osync_queue_cross_link(client->incoming, client->outgoing); 
    123128                osync_queue_unref(incoming); 
    124129        } 
    125130