You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2015/12/22 17:46:18 UTC

[2/2] qpid-dispatch git commit: DISPATCH-179 - Introduced 'T'-class addresses to replace the old "is-local" condition. T-class addresses are topological addresses that match "all" routers in an area or in all areas.

DISPATCH-179 - Introduced 'T'-class addresses to replace the old "is-local" condition.
               T-class addresses are topological addresses that match "all" routers in
               an area or in all areas.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/8be2a0a9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/8be2a0a9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/8be2a0a9

Branch: refs/heads/tross-DISPATCH-179-1
Commit: 8be2a0a9294b1fead41c258262096c43956fb5b2
Parents: 363baae
Author: Ted Ross <tr...@redhat.com>
Authored: Tue Dec 22 10:14:02 2015 -0500
Committer: Ted Ross <tr...@redhat.com>
Committed: Tue Dec 22 10:14:02 2015 -0500

----------------------------------------------------------------------
 src/iterator.c             |  7 +++-
 src/router_core/transfer.c | 84 +++++++++++++++++++++++++++++++++++++++++
 tests/field_test.c         |  8 ++--
 3 files changed, 94 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8be2a0a9/src/iterator.c
----------------------------------------------------------------------
diff --git a/src/iterator.c b/src/iterator.c
index 7a8f0ab..686447d 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -110,7 +110,12 @@ static void parse_address_view(qd_field_iterator_t *iter)
 
         if (qd_field_iterator_prefix(iter, "topo/")) {
             if (qd_field_iterator_prefix(iter, "all/") || qd_field_iterator_prefix(iter, my_area)) {
-                if (qd_field_iterator_prefix(iter, "all/") || qd_field_iterator_prefix(iter, my_router)) {
+                if (qd_field_iterator_prefix(iter, "all/")) {
+                    iter->prefix      = 'T';
+                    iter->state       = STATE_AT_PREFIX;
+                    iter->view_prefix = true;
+                    return;
+                } else if (qd_field_iterator_prefix(iter, my_router)) {
                     iter->prefix      = 'L';
                     iter->state       = STATE_AT_PREFIX;
                     iter->view_prefix = true;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8be2a0a9/src/router_core/transfer.c
----------------------------------------------------------------------
diff --git a/src/router_core/transfer.c b/src/router_core/transfer.c
new file mode 100644
index 0000000..d8a05ee
--- /dev/null
+++ b/src/router_core/transfer.c
@@ -0,0 +1,84 @@
+/*
+ * 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 "router_core_private.h"
+#include <qpid/dispatch/amqp.h>
+#include <stdio.h>
+
+static void qdr_link_deliver_CT(qdr_core_t *core, qdr_action_t *action, bool discard);
+static void qdr_link_deliver_to_CT(qdr_core_t *core, qdr_action_t *action, bool discard);
+static void qdr_send_to_CT(qdr_core_t *core, qdr_action_t *action, bool discard);
+
+
+//==================================================================================
+// Internal Functions
+//==================================================================================
+
+//==================================================================================
+// Interface Functions
+//==================================================================================
+
+qdr_delivery_t *qdr_link_deliver(qdr_link_t *link, pn_delivery_t *delivery, qd_message_t *msg)
+{
+    qdr_action_t *action = qdr_action(qdr_link_delivery_CT, "link_delivery");
+
+    qdr_action_enqueue(core, action);
+}
+
+
+qdr_delivery_t *qdr_link_deliver_to(qdr_link_t *link, pn_delivery_t *delivery, qd_message_t *msg, qd_field_iterator_t *addr)
+{
+    qdr_action_t *action = qdr_action(qdr_link_delivery_to_CT, "link_delivery_to");
+
+    qdr_action_enqueue(core, action);
+}
+
+
+void qdr_send_to(qdr_core_t *core, qd_message_t *msg, const char *addr, bool exclude_inprocess)
+{
+    qdr_action_t *action = qdr_action(qdr_send_to_CT, "send_to");
+
+    qdr_action_enqueue(core, action);
+}
+
+
+//==================================================================================
+// In-Thread Functions
+//==================================================================================
+
+static void qdr_link_delivery_CT(qdr_core_t *core, qdr_action_t *action, bool discard)
+{
+    if (discard)
+        return;
+}
+
+
+static void qdr_link_delivery_to_CT(qdr_core_t *core, qdr_action_t *action, bool discard)
+{
+    if (discard)
+        return;
+}
+
+
+static void qdr_send_to_CT(qdr_core_t *core, qdr_action_t *action, bool discard)
+{
+    if (discard)
+        return;
+}
+

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/8be2a0a9/tests/field_test.c
----------------------------------------------------------------------
diff --git a/tests/field_test.c b/tests/field_test.c
index a093505..e1ec6c6 100644
--- a/tests/field_test.c
+++ b/tests/field_test.c
@@ -159,8 +159,8 @@ static char* test_view_address_hash(void *context)
     {"amqp:/_topo/my-area/router/local/sub",    "Rrouter"},
     {"amqp:/_topo/my-area/my-router/local/sub", "Llocal/sub"},
     {"amqp:/_topo/area/all/local/sub",          "Aarea"},
-    {"amqp:/_topo/my-area/all/local/sub",       "Llocal/sub"},
-    {"amqp:/_topo/all/all/local/sub",           "Llocal/sub"},
+    {"amqp:/_topo/my-area/all/local/sub",       "Tlocal/sub"},
+    {"amqp:/_topo/all/all/local/sub",           "Tlocal/sub"},
     {"amqp://host:port/_local/my-addr",         "Lmy-addr"},
     {"_topo/area/router/my-addr",               "Aarea"},
     {"_topo/my-area/router/my-addr",            "Rrouter"},
@@ -175,8 +175,8 @@ static char* test_view_address_hash(void *context)
     {"amqp:/_topo/my-area/router/local/sub.",    "Rrouter"},
     {"amqp:/_topo/my-area/my-router/local/sub.", "Llocal/sub"},
     {"amqp:/_topo/area/all/local/sub.",          "Aarea"},
-    {"amqp:/_topo/my-area/all/local/sub.",       "Llocal/sub"},
-    {"amqp:/_topo/all/all/local/sub.",           "Llocal/sub"},
+    {"amqp:/_topo/my-area/all/local/sub.",       "Tlocal/sub"},
+    {"amqp:/_topo/all/all/local/sub.",           "Tlocal/sub"},
     {"amqp://host:port/_local/my-addr.",         "Lmy-addr"},
     {"_topo/area/router/my-addr.",               "Aarea"},
     {"_topo/my-area/router/my-addr.",            "Rrouter"},


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org