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

rbulter pushed a commit to branch feature/tcp_admin_segm
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/feature/tcp_admin_segm by this 
push:
     new 4666e62  Add message segmentation to tcp admin
4666e62 is described below

commit 4666e62905dcea4b799c860db8284355e41dc19b
Author: Roy Bulter <[email protected]>
AuthorDate: Tue Oct 6 22:06:16 2020 +0200

    Add message segmentation to tcp admin
---
 .../pubsub_admin_tcp/src/pubsub_tcp_common.c       | 38 ++++++++++++++++++++++
 bundles/pubsub/test/meta_data/ping3.properties     | 22 +++++++++++++
 bundles/pubsub/test/meta_data/pong3.properties     | 23 +++++++++++++
 3 files changed, 83 insertions(+)

diff --git a/bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_common.c 
b/bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_common.c
new file mode 100644
index 0000000..d8f05f7
--- /dev/null
+++ b/bundles/pubsub/pubsub_admin_tcp/src/pubsub_tcp_common.c
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include <stdio.h>
+#include <string.h>
+#include "pubsub_tcp_common.h"
+
+
+bool psa_tcp_isPassive(const char* buffer) {
+    bool isPassive = false;
+    // Parse Properties
+    if (buffer != NULL) {
+        char buf[32];
+        snprintf(buf, 32, "%s", buffer);
+        char *trimmed = utils_stringTrim(buf);
+        if (strncasecmp("true", trimmed, strlen("true")) == 0) {
+            isPassive = true;
+        } else if (strncasecmp("false", trimmed, strlen("false")) == 0) {
+            isPassive = false;
+        }
+    }
+    return isPassive;
+}
diff --git a/bundles/pubsub/test/meta_data/ping3.properties 
b/bundles/pubsub/test/meta_data/ping3.properties
new file mode 100644
index 0000000..cb64543
--- /dev/null
+++ b/bundles/pubsub/test/meta_data/ping3.properties
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tcp.passive.key=tcp://localhost:9500
+tcp.passive.configured=true
+#note only effective if run as root
+thread.realtime.sched=SCHED_FIFO
+thread.realtime.prio=50
+
diff --git a/bundles/pubsub/test/meta_data/pong3.properties 
b/bundles/pubsub/test/meta_data/pong3.properties
new file mode 100644
index 0000000..eec578f
--- /dev/null
+++ b/bundles/pubsub/test/meta_data/pong3.properties
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+tcp.passive.key=tcp://localhost
+tcp.passive.configured=true
+
+#note only effective if run as root
+thread.realtime.sched=SCHED_FIFO
+thread.realtime.prio=50
+

Reply via email to