You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by ganeshmurthy <gi...@git.apache.org> on 2017/06/20 18:33:54 UTC

[GitHub] qpid-dispatch pull request #169: DISPATCH-788 - Part 2 - Added a list of pee...

GitHub user ganeshmurthy opened a pull request:

    https://github.com/apache/qpid-dispatch/pull/169

    DISPATCH-788 - Part 2 - Added a list of peer references in case there…

    … is more than one peer. This will help in the future when we introduce large message streaming

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ganeshmurthy/qpid-dispatch DISPATCH-788-MASTER-R1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/qpid-dispatch/pull/169.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #169
    
----
commit a18ecc397ea2d084de2b5752c3f5c7f73049ab32
Author: Ganesh Murthy <gm...@redhat.com>
Date:   2017-06-20T18:24:30Z

    DISPATCH-788 - Part 2 - Added a list of peer references in case there is more than one peer. This will help in the future when we introduce large message streaming

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] qpid-dispatch pull request #169: DISPATCH-788 - Part 2 - Added a list of pee...

Posted by ted-ross <gi...@git.apache.org>.
Github user ted-ross commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/169#discussion_r123356056
  
    --- Diff: src/router_core/transfer.c ---
    @@ -412,14 +412,41 @@ static void qdr_delete_delivery_internal_CT(qdr_core_t *core, qdr_delivery_t *de
         free_qdr_delivery_t(delivery);
     }
     
    +static bool qdr_delivery_has_peer_CT(qdr_delivery_t *dlv)
    +{
    +    if (!dlv->peer && DEQ_SIZE(dlv->peers) == 0)
    --- End diff --
    
    You could do this more elegantly like this:
        return dlv->peer || DEQ_SIZE(dlv->peers) > 0;



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] qpid-dispatch pull request #169: DISPATCH-788 - Part 2 - Added a list of pee...

Posted by ganeshmurthy <gi...@git.apache.org>.
Github user ganeshmurthy closed the pull request at:

    https://github.com/apache/qpid-dispatch/pull/169


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] qpid-dispatch pull request #169: DISPATCH-788 - Part 2 - Added a list of pee...

Posted by ted-ross <gi...@git.apache.org>.
Github user ted-ross commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/169#discussion_r123356457
  
    --- Diff: src/router_core/transfer.c ---
    @@ -412,14 +412,41 @@ static void qdr_delete_delivery_internal_CT(qdr_core_t *core, qdr_delivery_t *de
         free_qdr_delivery_t(delivery);
     }
     
    +static bool qdr_delivery_has_peer_CT(qdr_delivery_t *dlv)
    +{
    +    if (!dlv->peer && DEQ_SIZE(dlv->peers) == 0)
    +        return false;
    +    return true;
    +}
    +
     
     void qdr_delivery_link_peers_CT(qdr_delivery_t *in_dlv, qdr_delivery_t *out_dlv)
     {
    -    assert(!in_dlv->peer);
    -    assert(!out_dlv->peer);
    +    // If there is no delivery or a peer, we cannot link each other.
    +    if (!in_dlv || !out_dlv)
    +        return;
    +
    +    if (!qdr_delivery_has_peer_CT(in_dlv)) {
    +        // This is the very first peer. Link them up.
    +        assert(!out_dlv->peer);
     
    -    out_dlv->peer = in_dlv;
    -    in_dlv->peer = out_dlv;
    +        out_dlv->peer = in_dlv;
    +        in_dlv->peer = out_dlv;
    +    }
    +    else {
    +        if (in_dlv->peer) {
    +            // This is the first time we know that in_dlv is going to have more than one peer.
    +            // There is already a peer in the in_dlv->peer pointer, move it into a list and zero it out.
    +            qdr_add_delivery_ref_CT(&in_dlv->peers, in_dlv->peer);
    +
    +            // Zero out the peer pointer. Since there is more than one peer, this peer has been moved to the "peers" linked list.
    +            // All peers will now reside in the peers linked list. No need to decref/incref here because you are transferring ownership.
    +            in_dlv->peer = 0;
    +        }
    +
    +        out_dlv->peer = in_dlv;
    --- End diff --
    
    Minor point:  You repeat this line.  Why not do this once outside of the if-then-else.  The condition does not affect the backward linkage from out to in.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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