celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abroekh...@apache.org
Subject svn commit: r1658988 - in /celix/trunk/remote_services: discovery/private/src/endpoint_discovery_poller.c discovery_etcd/private/include/etcd.h discovery_etcd/private/src/etcd.c discovery_etcd/private/src/etcd_watcher.c
Date Wed, 11 Feb 2015 15:18:29 GMT
Author: abroekhuis
Date: Wed Feb 11 15:18:28 2015
New Revision: 1658988

URL: http://svn.apache.org/r1658988
Log:
CELIX-215: Removed obsolete usages of curl_global_init and curl_global_cleanup

Now that the launcher does the curl_global_init/cleanup, any other usage had to be removed.
It is only needed once.

Modified:
    celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c
    celix/trunk/remote_services/discovery_etcd/private/include/etcd.h
    celix/trunk/remote_services/discovery_etcd/private/src/etcd.c
    celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c

Modified: celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c?rev=1658988&r1=1658987&r2=1658988&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c (original)
+++ celix/trunk/remote_services/discovery/private/src/endpoint_discovery_poller.c Wed Feb
11 15:18:28 2015
@@ -337,7 +337,6 @@ static celix_status_t endpointDiscoveryP
     chunk.memory = malloc(1);
     chunk.size = 0;
 
-    curl_global_init(CURL_GLOBAL_ALL);
     curl = curl_easy_init();
     if (!curl) {
         status = CELIX_ILLEGAL_STATE;
@@ -370,7 +369,6 @@ static celix_status_t endpointDiscoveryP
         free(chunk.memory);
     }
 
-    curl_global_cleanup();
     return status;
 }
 

Modified: celix/trunk/remote_services/discovery_etcd/private/include/etcd.h
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_etcd/private/include/etcd.h?rev=1658988&r1=1658987&r2=1658988&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_etcd/private/include/etcd.h (original)
+++ celix/trunk/remote_services/discovery_etcd/private/include/etcd.h Wed Feb 11 15:18:28
2015
@@ -2,6 +2,7 @@
 #define ETCD_H_
 
 #include <stdbool.h>
+#include <celix_errno.h>
 
 #define MAX_NODES			256
 
@@ -20,7 +21,7 @@
 #define ETCD_JSON_VALUE			"value"
 #define ETCD_JSON_MODIFIEDINDEX	"modifiedIndex"
 
-bool etcd_init(char* server, int port);
+celix_status_t etcd_init(char* server, int port);
 bool etcd_get(char* key, char* value, char*action, int* modifiedIndex);
 bool etcd_getNodes(char* directory, char** nodeNames, int* size);
 bool etcd_set(char* key, char* value, int ttl, bool prevExist);

Modified: celix/trunk/remote_services/discovery_etcd/private/src/etcd.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_etcd/private/src/etcd.c?rev=1658988&r1=1658987&r2=1658988&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_etcd/private/src/etcd.c (original)
+++ celix/trunk/remote_services/discovery_etcd/private/src/etcd.c Wed Feb 11 15:18:28 2015
@@ -70,11 +70,13 @@ static int performRequest(char* url, req
 }
 
 // open
-bool etcd_init(char* server, int port) {
+celix_status_t etcd_init(char* server, int port) {
+	celix_status_t status = CELIX_SUCCESS;
+
 	etcd_server = server;
 	etcd_port = port;
 
-	return curl_global_init(CURL_GLOBAL_ALL) == 0;
+	return status;
 }
 
 // get

Modified: celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c
URL: http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c?rev=1658988&r1=1658987&r2=1658988&view=diff
==============================================================================
--- celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c (original)
+++ celix/trunk/remote_services/discovery_etcd/private/src/etcd_watcher.c Wed Feb 11 15:18:28
2015
@@ -290,9 +290,10 @@ celix_status_t etcdWatcher_create(discov
 		}
 	}
 
-	if (etcd_init(etcd_server, etcd_port) == false)
+	status = etcd_init(etcd_server, etcd_port);
+	if (status != CELIX_SUCCESS)
 	{
-		return CELIX_BUNDLE_EXCEPTION;
+		return status;
 	}
 
 	etcdWatcher_addOwnFramework(*watcher);



Mime
View raw message