Ticket #1190: fix_osplugin_plugin_queue_v2.diff

File fix_osplugin_plugin_queue_v2.diff, 3.0 KB (added by dgollub, 5 years ago)

Adapted patch, don't include private headers, don't cross-link without pipes

  • opensync/ipc/opensync_queue_internals.h

     
    9090OSYNC_TEST_EXPORT void osync_queue_set_message_handler(OSyncQueue *queue, OSyncMessageHandler handler, gpointer user_data); 
    9191 
    9292/** 
    93  * @brief Cross links command queue and reply queue 
    94  *  
    95  * Stores the queue used for replies in the command queue object so 
    96  * that timeout responses can be sent if necessary. 
    97  * And stores the command queue in the reply queue object so that 
    98  * replies can remove pending messages before they time out. 
    99  *  
    100  * @param cmd_queue The command queue used to receive incoming commands 
    101  * @param reply_queue The queue used to send replies  
    102  *  
    103  */ 
    104 OSYNC_TEST_EXPORT void osync_queue_cross_link(OSyncQueue *cmd_queue, OSyncQueue *reply_queue); 
    105  
    106 /** 
    10793 * @brief Remove cross links between command queues and reply queues 
    10894 *  
    10995 * Removes the cross-links from this queue and all queues linked 
  • 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 
    123137/*@}*/ 
    124138#endif /* _OPENSYNC_QUEUE_H */ 
    125139 
  • 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" 
    2628 
    2729static void usage (int ecode) 
    2830{ 
     
    99101                if (!osync_client_set_incoming_queue(client, incoming, &error)) 
    100102                        goto error; 
    101103 
    102                 osync_queue_unref(incoming); 
    103104                if (!osync_client_set_outgoing_queue(client, outgoing, &error)) 
    104105                        goto error; 
    105106 
     107                osync_queue_cross_link(incoming, outgoing); 
     108 
     109                osync_queue_unref(incoming); 
    106110                osync_queue_unref(outgoing); 
    107111        } else { 
    108112                /* Create connection pipes **/ 
  • opensync.sym

     
    654654osync_plugin_unref 
    655655osync_queue_connect 
    656656osync_queue_create 
     657osync_queue_cross_link 
    657658osync_queue_disconnect 
    658659osync_queue_new 
    659660osync_queue_new_from_fd