You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2020/06/01 20:44:06 UTC

[GitHub] [qpid-dispatch] ted-ross opened a new pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

ted-ross opened a new pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751


   This is a working branch and is not yet intended for merging to the master.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] ted-ross closed pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
ted-ross closed pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#discussion_r445080450



##########
File path: src/message.c
##########
@@ -2178,6 +2197,130 @@ void qd_message_compose_4(qd_message_t *msg, qd_composed_field_t *field1, qd_com
 }
 
 
+void qd_message_compose_5(qd_message_t        *msg,
+                          qd_composed_field_t *headers,
+                          qd_buffer_list_t    *body,
+                          bool                 complete)
+{
+    qd_message_content_t *content         = MSG_CONTENT(msg);
+    qd_buffer_list_t     *headers_buffers = headers ? qd_compose_buffers(headers) : 0;
+
+    DEQ_INIT(content->buffers);
+    if (headers_buffers)
+        DEQ_APPEND(content->buffers, (*headers_buffers));
+
+    if (body) {
+        DEQ_APPEND(content->buffers, (*body));
+    }
+
+    content->receive_complete = complete;
+}
+
+
+int qd_message_extend(qd_message_t *msg, qd_buffer_list_t *buffers)
+{
+    qd_message_content_t *content = MSG_CONTENT(msg);
+    qd_buffer_t          *buf     = DEQ_HEAD(*buffers);
+    int                   count;
+
+    LOCK(content->lock);
+    while (buf) {
+        qd_buffer_set_fanout(buf, content->fanout);
+        buf = DEQ_NEXT(buf);
+    }
+
+    DEQ_APPEND(content->buffers, (*buffers));
+    count = DEQ_SIZE(content->buffers);
+    UNLOCK(content->lock);
+    return count;
+}
+
+
+int qd_message_read_body(qd_message_t *in_msg, pn_raw_buffer_t* buffers, int length)

Review comment:
       Idea - why not get rid of qd_message_receive() and qd_message_send() APIs and instead use a generic buffer-append buffer-pop API?  qd_message_receive() and qd_message_send() are proton specific and maybe that logic belongs in the AMQP default adaptor?
   
   You've basically added that buffer-pop API for the message sender side, might as well go whole hog and take the pn_* stuff out of the message entirely.
   
   Of course I haven't really thought of the implications and have been drinking lots of coffee at the moment...




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] codecov-commenter edited a comment on pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#issuecomment-637657906


   # [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=h1) Report
   > Merging [#751](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=desc) into [master](https://codecov.io/gh/apache/qpid-dispatch/commit/d8e09c4390fe452cec197fe860305ae4e8858925&el=desc) will **decrease** coverage by `0.77%`.
   > The diff coverage is `30.59%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/qpid-dispatch/pull/751/graphs/tree.svg?width=650&height=150&src=pr&token=rk2Cgd27pP)](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #751      +/-   ##
   ==========================================
   - Coverage   86.60%   85.83%   -0.78%     
   ==========================================
     Files          96       97       +1     
     Lines       21930    22171     +241     
   ==========================================
   + Hits        18993    19030      +37     
   - Misses       2937     3141     +204     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [src/adaptors/reference\_adaptor.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL2FkYXB0b3JzL3JlZmVyZW5jZV9hZGFwdG9yLmM=) | `0.00% <0.00%> (ø)` | |
   | [src/message.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL21lc3NhZ2UuYw==) | `88.96% <0.00%> (-2.44%)` | :arrow_down: |
   | [src/server.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3NlcnZlci5j) | `85.87% <0.00%> (-0.61%)` | :arrow_down: |
   | [src/router\_core/router\_core\_thread.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3JvdXRlcl9jb3JlX3RocmVhZC5j) | `89.00% <42.10%> (-11.00%)` | :arrow_down: |
   | [src/router\_core/terminus.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3Rlcm1pbnVzLmM=) | `87.12% <71.42%> (-0.62%)` | :arrow_down: |
   | [src/router\_core/connections.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2Nvbm5lY3Rpb25zLmM=) | `91.70% <96.77%> (-0.09%)` | :arrow_down: |
   | [src/router\_core/agent\_connection.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2FnZW50X2Nvbm5lY3Rpb24uYw==) | `84.84% <100.00%> (+0.11%)` | :arrow_up: |
   | [src/router\_core/delivery.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2RlbGl2ZXJ5LmM=) | `90.90% <100.00%> (+0.37%)` | :arrow_up: |
   | [.../streaming\_link\_scrubber/streaming\_link\_scrubber.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL21vZHVsZXMvc3RyZWFtaW5nX2xpbmtfc2NydWJiZXIvc3RyZWFtaW5nX2xpbmtfc2NydWJiZXIuYw==) | `95.31% <100.00%> (ø)` | |
   | [src/router\_core/router\_core.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3JvdXRlcl9jb3JlLmM=) | `85.92% <100.00%> (+0.69%)` | :arrow_up: |
   | ... and [17 more](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=footer). Last update [d8e09c4...e62ecba](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] codecov-commenter edited a comment on pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#issuecomment-637657906


   # [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=h1) Report
   > Merging [#751](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=desc) into [master](https://codecov.io/gh/apache/qpid-dispatch/commit/d8e09c4390fe452cec197fe860305ae4e8858925&el=desc) will **decrease** coverage by `0.70%`.
   > The diff coverage is `32.38%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/qpid-dispatch/pull/751/graphs/tree.svg?width=650&height=150&src=pr&token=rk2Cgd27pP)](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #751      +/-   ##
   ==========================================
   - Coverage   86.60%   85.90%   -0.71%     
   ==========================================
     Files          96       97       +1     
     Lines       21930    22151     +221     
   ==========================================
   + Hits        18993    19029      +36     
   - Misses       2937     3122     +185     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [src/adaptors/reference\_adaptor.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL2FkYXB0b3JzL3JlZmVyZW5jZV9hZGFwdG9yLmM=) | `0.00% <0.00%> (ø)` | |
   | [src/message.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL21lc3NhZ2UuYw==) | `89.13% <0.00%> (-2.27%)` | :arrow_down: |
   | [src/server.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3NlcnZlci5j) | `85.98% <0.00%> (-0.49%)` | :arrow_down: |
   | [src/router\_core/router\_core\_thread.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3JvdXRlcl9jb3JlX3RocmVhZC5j) | `89.00% <42.10%> (-11.00%)` | :arrow_down: |
   | [src/router\_core/terminus.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3Rlcm1pbnVzLmM=) | `87.12% <71.42%> (-0.62%)` | :arrow_down: |
   | [src/router\_core/delivery.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2RlbGl2ZXJ5LmM=) | `90.53% <88.88%> (ø)` | |
   | [src/router\_core/connections.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2Nvbm5lY3Rpb25zLmM=) | `91.70% <96.77%> (-0.09%)` | :arrow_down: |
   | [src/router\_core/agent\_connection.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2FnZW50X2Nvbm5lY3Rpb24uYw==) | `84.84% <100.00%> (+0.11%)` | :arrow_up: |
   | [src/router\_core/router\_core.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3JvdXRlcl9jb3JlLmM=) | `85.92% <100.00%> (+0.69%)` | :arrow_up: |
   | [src/router\_core/transfer.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3RyYW5zZmVyLmM=) | `93.99% <100.00%> (+0.72%)` | :arrow_up: |
   | ... and [13 more](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=footer). Last update [d8e09c4...c36dd73](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#discussion_r445084601



##########
File path: src/router_core/connections.c
##########
@@ -273,7 +289,7 @@ int qdr_connection_process(qdr_connection_t *conn)
     int event_count = 0;
 
     if (conn->closed) {
-        core->conn_close_handler(core->user_context, conn, conn->error);
+        conn->protocol_adaptor->conn_close_handler(conn->protocol_adaptor->user_context, conn, conn->error);

Review comment:
       consider caching the value of conn->protocol_adaptor in a local variable - shorter lines and maybe faster?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#discussion_r445081560



##########
File path: src/router_core/delivery.c
##########
@@ -25,7 +25,7 @@ ALLOC_DEFINE(qdr_delivery_t);
 
 static void qdr_update_delivery_CT(qdr_core_t *core, qdr_action_t *action, bool discard);
 static void qdr_delete_delivery_CT(qdr_core_t *core, qdr_action_t *action, bool discard);
-static void qdr_deliver_continue_CT(qdr_core_t *core, qdr_action_t *action, bool discard);
+static void qdr_delivery_continue_CT(qdr_core_t *core, qdr_action_t *action, bool discard);

Review comment:
       You've just saved me man hours spent correcting my use of "grep" to find all qdr_delivery* methods!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] codecov-commenter commented on pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#issuecomment-637657906


   # [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=h1) Report
   > Merging [#751](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=desc) into [master](https://codecov.io/gh/apache/qpid-dispatch/commit/d8e09c4390fe452cec197fe860305ae4e8858925&el=desc) will **decrease** coverage by `0.03%`.
   > The diff coverage is `84.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/qpid-dispatch/pull/751/graphs/tree.svg?width=650&height=150&src=pr&token=rk2Cgd27pP)](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #751      +/-   ##
   ==========================================
   - Coverage   86.60%   86.57%   -0.04%     
   ==========================================
     Files          96       97       +1     
     Lines       21930    21996      +66     
   ==========================================
   + Hits        18993    19043      +50     
   - Misses       2937     2953      +16     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [src/adaptors/tcp\_adaptor.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL2FkYXB0b3JzL3RjcF9hZGFwdG9yLmM=) | `38.46% <38.46%> (ø)` | |
   | [src/router\_core/agent\_connection.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2FnZW50X2Nvbm5lY3Rpb24uYw==) | `84.84% <100.00%> (+0.11%)` | :arrow_up: |
   | [src/router\_core/connections.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2Nvbm5lY3Rpb25zLmM=) | `91.67% <100.00%> (-0.12%)` | :arrow_down: |
   | [src/router\_core/router\_core.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3JvdXRlcl9jb3JlLmM=) | `85.89% <100.00%> (+0.66%)` | :arrow_up: |
   | [src/router\_core/router\_core\_thread.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3JvdXRlcl9jb3JlX3RocmVhZC5j) | `100.00% <100.00%> (ø)` | |
   | [src/router\_core/transfer.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL3RyYW5zZmVyLmM=) | `93.75% <100.00%> (+0.48%)` | :arrow_up: |
   | [src/router\_node.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9ub2RlLmM=) | `93.37% <100.00%> (+0.01%)` | :arrow_up: |
   | [include/qpid/dispatch/atomic.h](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-aW5jbHVkZS9xcGlkL2Rpc3BhdGNoL2F0b21pYy5o) | `93.75% <0.00%> (-6.25%)` | :arrow_down: |
   | [src/router\_core/agent\_config\_address.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3JvdXRlcl9jb3JlL2FnZW50X2NvbmZpZ19hZGRyZXNzLmM=) | `79.65% <0.00%> (-1.25%)` | :arrow_down: |
   | [src/server.c](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree#diff-c3JjL3NlcnZlci5j) | `86.36% <0.00%> (-0.12%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/qpid-dispatch/pull/751/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=footer). Last update [d8e09c4...22e714b](https://codecov.io/gh/apache/qpid-dispatch/pull/751?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#discussion_r445087286



##########
File path: src/router_core/router_core_thread.c
##########
@@ -123,6 +144,33 @@ void qdr_modules_finalize(qdr_core_t *core)
 }
 
 
+void qdr_adaptors_init(qdr_core_t *core)
+{
+    //
+    // Initialize registered adaptors
+    //
+    qdrc_adaptor_t *adaptor = DEQ_HEAD(registered_adaptors);
+    while (adaptor) {
+        adaptor->on_init(core, &adaptor->context);
+        adaptor = DEQ_NEXT(adaptor);
+    }
+}
+
+
+void qdr_adaptors_finalize(qdr_core_t *core)
+{
+    //
+    // Finalize registered adaptors
+    //
+    qdrc_adaptor_t *adaptor = DEQ_TAIL(registered_adaptors);

Review comment:
       no free_qdr_adaptor_t() call?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#discussion_r445728883



##########
File path: src/message.c
##########
@@ -2178,6 +2197,130 @@ void qd_message_compose_4(qd_message_t *msg, qd_composed_field_t *field1, qd_com
 }
 
 
+void qd_message_compose_5(qd_message_t        *msg,
+                          qd_composed_field_t *headers,
+                          qd_buffer_list_t    *body,
+                          bool                 complete)
+{
+    qd_message_content_t *content         = MSG_CONTENT(msg);
+    qd_buffer_list_t     *headers_buffers = headers ? qd_compose_buffers(headers) : 0;
+
+    DEQ_INIT(content->buffers);
+    if (headers_buffers)
+        DEQ_APPEND(content->buffers, (*headers_buffers));
+
+    if (body) {
+        DEQ_APPEND(content->buffers, (*body));
+    }
+
+    content->receive_complete = complete;
+}
+
+
+int qd_message_extend(qd_message_t *msg, qd_buffer_list_t *buffers)
+{
+    qd_message_content_t *content = MSG_CONTENT(msg);
+    qd_buffer_t          *buf     = DEQ_HEAD(*buffers);
+    int                   count;
+
+    LOCK(content->lock);
+    while (buf) {
+        qd_buffer_set_fanout(buf, content->fanout);
+        buf = DEQ_NEXT(buf);
+    }
+
+    DEQ_APPEND(content->buffers, (*buffers));
+    count = DEQ_SIZE(content->buffers);
+    UNLOCK(content->lock);
+    return count;
+}
+
+
+int qd_message_read_body(qd_message_t *in_msg, pn_raw_buffer_t* buffers, int length)
+{
+    qd_message_pvt_t     *msg     = (qd_message_pvt_t*) in_msg;
+    if (!(msg->cursor.buffer && msg->cursor.cursor)) {
+        qd_field_location_t  *loc     = qd_message_field_location(in_msg, QD_FIELD_BODY);
+        if (!loc || loc->tag == QD_AMQP_NULL)
+            return 0;
+        // TODO: need to actually determine this, could be different if vbin32 sent
+        int preamble = 5;
+        if (loc->offset + preamble < qd_buffer_size(loc->buffer)) {
+            msg->cursor.buffer = loc->buffer;
+            msg->cursor.cursor = qd_buffer_base(loc->buffer) + loc->offset + preamble;
+        } else {
+            msg->cursor.buffer = DEQ_NEXT(loc->buffer);
+            if (!msg->cursor.buffer) return 0;
+            msg->cursor.cursor = qd_buffer_base(msg->cursor.buffer) + ((loc->offset + preamble) - qd_buffer_size(loc->buffer));
+        }
+    }
+
+    qd_buffer_t   *buf    = msg->cursor.buffer;
+    unsigned char *cursor = msg->cursor.cursor;
+
+    // if we are at the end of the current buffer, try to move to the
+    // next buffer
+    if (cursor == qd_buffer_base(buf) + qd_buffer_size(buf)) {
+        buf = DEQ_NEXT(buf);
+        if (buf) {
+            cursor = qd_buffer_base(buf);
+            msg->cursor.buffer = buf;
+            msg->cursor.cursor = cursor;
+        } else {
+            return 0;
+        }
+    }
+
+    int count;
+    for (count = 0; count < length && buf; count++) {
+        buffers[count].bytes = (char*) qd_buffer_base(buf);
+        buffers[count].capacity = qd_buffer_size(buf);
+        buffers[count].size = qd_buffer_size(buf);
+        buffers[count].offset = cursor - qd_buffer_base(buf);
+        buffers[count].context = (uintptr_t) buf;
+        buf = DEQ_NEXT(buf);
+        if (buf) {
+            cursor = qd_buffer_base(buf);
+            msg->cursor.buffer = buf;
+            msg->cursor.cursor = cursor;
+        } else {
+            msg->cursor.cursor = qd_buffer_base(msg->cursor.buffer) + qd_buffer_size(msg->cursor.buffer);
+        }
+    }
+    return count;
+}
+
+
+void qd_message_release_body(qd_message_t *msg, pn_raw_buffer_t *buffers, int buffer_count)
+{
+    qd_message_pvt_t     *pvt     = (qd_message_pvt_t*) msg;
+    qd_message_content_t *content = MSG_CONTENT(msg);
+    qd_buffer_t          *buf;
+
+    LOCK(content->lock);
+    //
+    // Decrement the buffer fanout for each of the referenced buffers.
+    //
+    if (pvt->is_fanout) {
+        for (int i = 0; i < buffer_count; i++) {
+            buf = (qd_buffer_t*) buffers[i].context;
+            qd_buffer_dec_fanout(buf);

Review comment:
       Will this need to handle release of Q2 flow control on the corresponding incoming link?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] ganeshmurthy commented on a change in pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
ganeshmurthy commented on a change in pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#discussion_r446364028



##########
File path: src/router_core/connections.c
##########
@@ -1563,16 +1567,67 @@ static void qdr_attach_link_downlink_CT(qdr_core_t *core, qdr_connection_t *conn
 }
 
 
+static void qdr_link_process_initial_delivery_CT(qdr_core_t *core, qdr_link_t *link, qdr_delivery_t *dlv)

Review comment:
       I feel this function should be called qdr_link_forward_initial_delivery_CT




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #751: Adaptor-plugin refactoring for multi-protocol data plane

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #751:
URL: https://github.com/apache/qpid-dispatch/pull/751#discussion_r445728133



##########
File path: src/message.c
##########
@@ -2178,6 +2197,130 @@ void qd_message_compose_4(qd_message_t *msg, qd_composed_field_t *field1, qd_com
 }
 
 
+void qd_message_compose_5(qd_message_t        *msg,
+                          qd_composed_field_t *headers,
+                          qd_buffer_list_t    *body,
+                          bool                 complete)
+{
+    qd_message_content_t *content         = MSG_CONTENT(msg);
+    qd_buffer_list_t     *headers_buffers = headers ? qd_compose_buffers(headers) : 0;
+
+    DEQ_INIT(content->buffers);
+    if (headers_buffers)
+        DEQ_APPEND(content->buffers, (*headers_buffers));
+
+    if (body) {
+        DEQ_APPEND(content->buffers, (*body));
+    }
+
+    content->receive_complete = complete;
+}
+
+
+int qd_message_extend(qd_message_t *msg, qd_buffer_list_t *buffers)

Review comment:
       Does this need to take into account Q2 threshold or Max Message Size functionality?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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