This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch hotfix/rsa_use_after_free
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/hotfix/rsa_use_after_free by 
this push:
     new 68de974  Make indentation consistent in this single function.
68de974 is described below

commit 68de974fb844f5934b499f085f03a9cb050d0805
Author: PengZheng <[email protected]>
AuthorDate: Sat Mar 26 16:21:36 2022 +0800

    Make indentation consistent in this single function.
---
 .../src/endpoint_discovery_poller.c                | 64 +++++++++++-----------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git 
a/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c 
b/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
index b03f2a7..194fa13 100644
--- a/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
+++ b/bundles/remote_services/discovery_common/src/endpoint_discovery_poller.c
@@ -249,45 +249,45 @@ celix_status_t 
endpointDiscoveryPoller_removeDiscoveryEndpoint(endpoint_discover
 
 
 celix_status_t endpointDiscoveryPoller_poll(endpoint_discovery_poller_t 
*poller, char *url, array_list_pt currentEndpoints) {
-       celix_status_t status;
-       array_list_pt updatedEndpoints = NULL;
+    celix_status_t status;
+    array_list_pt updatedEndpoints = NULL;
 
-       // create an arraylist with a custom equality test to ensure we can 
find endpoints properly...
-       
arrayList_createWithEquals(endpointDiscoveryPoller_endpointDescriptionEquals, 
&updatedEndpoints);
-       status = endpointDiscoveryPoller_getEndpoints(poller, url, 
&updatedEndpoints);
+    // create an arraylist with a custom equality test to ensure we can find 
endpoints properly...
+    
arrayList_createWithEquals(endpointDiscoveryPoller_endpointDescriptionEquals, 
&updatedEndpoints);
+    status = endpointDiscoveryPoller_getEndpoints(poller, url, 
&updatedEndpoints);
 
-       if (status == CELIX_SUCCESS) {
-               if (updatedEndpoints != NULL) {
-                       for (unsigned int i = arrayList_size(currentEndpoints); 
i > 0; i--) {
-                               endpoint_description_t *endpoint = 
arrayList_get(currentEndpoints, i - 1);
+    if (status == CELIX_SUCCESS) {
+        if (updatedEndpoints != NULL) {
+            for (unsigned int i = arrayList_size(currentEndpoints); i > 0; 
i--) {
+                endpoint_description_t *endpoint = 
arrayList_get(currentEndpoints, i - 1);
 
-                               if (!arrayList_contains(updatedEndpoints, 
endpoint)) {
-                                       status = 
discovery_removeDiscoveredEndpoint(poller->discovery, endpoint);
-                                       arrayList_remove(currentEndpoints, i - 
1);
-                                       endpointDescription_destroy(endpoint);
-                               }
-                       }
-
-                       for (int i = arrayList_size(updatedEndpoints); i > 0; 
i--) {
-                               endpoint_description_t *endpoint = 
arrayList_remove(updatedEndpoints, 0);
-
-                               if (!arrayList_contains(currentEndpoints, 
endpoint)) {
-                                       arrayList_add(currentEndpoints, 
endpoint);
-                                       status = 
discovery_addDiscoveredEndpoint(poller->discovery, endpoint);
-                               } else {
+                if (!arrayList_contains(updatedEndpoints, endpoint)) {
                     status = 
discovery_removeDiscoveredEndpoint(poller->discovery, endpoint);
-                                       endpointDescription_destroy(endpoint);
+                    arrayList_remove(currentEndpoints, i - 1);
+                    endpointDescription_destroy(endpoint);
+                }
+            }
+
+            for (int i = arrayList_size(updatedEndpoints); i > 0; i--) {
+                endpoint_description_t *endpoint = 
arrayList_remove(updatedEndpoints, 0);
+
+                if (!arrayList_contains(currentEndpoints, endpoint)) {
+                    arrayList_add(currentEndpoints, endpoint);
+                    status = 
discovery_addDiscoveredEndpoint(poller->discovery, endpoint);
+                } else {
+                    status = 
discovery_removeDiscoveredEndpoint(poller->discovery, endpoint);
+                    endpointDescription_destroy(endpoint);
 
-                               }
-                       }
-               }
-       }
+                }
+            }
+        }
+    }
 
-       if (updatedEndpoints != NULL) {
-               arrayList_destroy(updatedEndpoints);
-       }
+    if (updatedEndpoints != NULL) {
+        arrayList_destroy(updatedEndpoints);
+    }
 
-       return status;
+    return status;
 }
 
 static void *endpointDiscoveryPoller_performPeriodicPoll(void *data) {

Reply via email to