Browse code

dmq: Add find_dmq_node_uri function to API - based on patch submitted by Andrey Rybkin.

Charles Chance authored on 13/11/2014 21:43:22
Showing 4 changed files
... ...
@@ -34,6 +34,7 @@ int bind_dmq(dmq_api_t* api) {
34 34
 	api->register_dmq_peer = register_dmq_peer;
35 35
 	api->send_message = dmq_send_message;
36 36
 	api->bcast_message = bcast_dmq_message;
37
+	api->find_dmq_node_uri = find_dmq_node_uri2;
37 38
 	return 0;
38 39
 }
39 40
 
... ...
@@ -34,11 +34,13 @@ typedef int (*bcast_message_t)(dmq_peer_t* peer, str* body, dmq_node_t* except,
34 34
 		dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type);
35 35
 typedef int (*send_message_t)(dmq_peer_t* peer, str* body, dmq_node_t* node,
36 36
 		dmq_resp_cback_t* resp_cback, int max_forwards, str* content_type);
37
+typedef dmq_node_t* (*find_dmq_node_uri_t)(str* uri);
37 38
 
38 39
 typedef struct dmq_api {
39 40
 	register_dmq_peer_t register_dmq_peer;
40 41
 	bcast_message_t bcast_message;
41 42
 	send_message_t send_message;
43
+	find_dmq_node_uri_t find_dmq_node_uri;
42 44
 } dmq_api_t;
43 45
 
44 46
 typedef int (*bind_dmq_f)(dmq_api_t* api);
... ...
@@ -239,6 +239,11 @@ dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri)
239 239
 	return ret;
240 240
 }
241 241
 
242
+dmq_node_t* find_dmq_node_uri2(str* uri)
243
+{
244
+	return find_dmq_node_uri(node_list, uri);
245
+}
246
+
242 247
 /**
243 248
  * @brief destroy dmq node
244 249
  */
... ...
@@ -66,6 +66,7 @@ int update_node_list(dmq_node_list_t* remote_list);
66 66
 dmq_node_t* add_dmq_node(dmq_node_list_t* list, str* uri);
67 67
 dmq_node_t* find_dmq_node(dmq_node_list_t* list, dmq_node_t* node);
68 68
 dmq_node_t* find_dmq_node_uri(dmq_node_list_t* list, str* uri);
69
+dmq_node_t* find_dmq_node_uri2(str* uri);
69 70
 int del_dmq_node(dmq_node_list_t* list, dmq_node_t* node);
70 71
 int cmp_dmq_node(dmq_node_t* node, dmq_node_t* cmpnode);
71 72
 dmq_node_t* shm_dup_node(dmq_node_t* node);