You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by bp...@apache.org on 2015/10/07 09:51:46 UTC

celix git commit: CELIX-267: add additional check whether endpoint is available

Repository: celix
Updated Branches:
  refs/heads/develop 7215825e4 -> 397510293


CELIX-267: add additional check whether endpoint is available


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/39751029
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/39751029
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/39751029

Branch: refs/heads/develop
Commit: 39751029394b81caafe0395a4b5aea75dd07da7b
Parents: 7215825
Author: Bjoern Petri <bp...@apache.org>
Authored: Wed Oct 7 09:51:02 2015 +0200
Committer: Bjoern Petri <bp...@apache.org>
Committed: Wed Oct 7 09:51:02 2015 +0200

----------------------------------------------------------------------
 .../private/src/remote_service_admin_impl.c                       | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/39751029/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
----------------------------------------------------------------------
diff --git a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
index 023d8fb..d6aee31 100644
--- a/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
+++ b/remote_services/remote_service_admin_http/private/src/remote_service_admin_impl.c
@@ -322,7 +322,7 @@ static int remoteServiceAdmin_callback(struct mg_connection *conn) {
 				for (expIt = 0; expIt < arrayList_size(exports); expIt++) {
 					export_registration_pt export = arrayList_get(exports, expIt);
 					long serviceId = atol(service);
-					if (serviceId == export->endpointDescription->serviceId) {
+					if (serviceId == export->endpointDescription->serviceId && export->endpoint != NULL) {
 						uint64_t datalength = request_info->content_length;
 						char* data = malloc(datalength + 1);
 						mg_read(conn, data, datalength);
@@ -447,6 +447,7 @@ celix_status_t remoteServiceAdmin_exportService(remote_service_admin_pt admin, c
 				exportRegistration_open(registration);
 				exportRegistration_startTracking(registration);
 			}
+
 			celixThreadMutex_lock(&admin->exportedServicesLock);
 			hashMap_put(admin->exportedServices, reference, *registrations);
 			celixThreadMutex_unlock(&admin->exportedServicesLock);