[ 
https://issues.apache.org/jira/browse/DISPATCH-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15194074#comment-15194074
 ] 

ASF GitHub Bot commented on DISPATCH-179:
-----------------------------------------

Github user ted-ross commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/59#discussion_r56070842
  
    --- Diff: src/router_core/agent_link.c ---
    @@ -229,3 +242,185 @@ void qdra_link_get_next_CT(qdr_core_t *core, 
qdr_query_t *query)
         //
         qdr_agent_enqueue_response_CT(core, query);
     }
    +
    +
    +static void qdr_manage_write_response_map_CT(qd_composed_field_t *body, 
qdr_link_t *link)
    +{
    +    qd_compose_start_map(body);
    +
    +    for(int i = 0; i < QDR_LINK_COLUMN_COUNT; i++) {
    +        qd_compose_insert_string(body, qdr_link_columns[i]);
    +        qdr_agent_write_column_CT(body, i, link);
    +    }
    +
    +    qd_compose_end_map(body);
    +}
    +
    +
    +static qdr_link_t *qdr_link_find_by_identity(qdr_core_t *core, 
qd_field_iterator_t *identity)
    +{
    +    if (!identity)
    +        return 0;
    +
    +    qdr_link_t *link = DEQ_HEAD(core->open_links);
    +
    +    while(link) {
    +        char id[100];
    +        if (link->identifier) {
    +            snprintf(id, 100, "%ld", link->identifier);
    +            if (qd_field_iterator_equal(identity, (const unsigned char 
*)id))
    +                break;
    +        }
    +        link = DEQ_NEXT(link);
    +    }
    +
    +    return link;
    +
    +}
    +
    +
    +static qdr_link_t *qdr_link_find_by_name(qdr_core_t *core, 
qd_field_iterator_t *name)
    +{
    +    if(!name)
    +        return 0;
    +
    +    qdr_link_t *link = DEQ_HEAD(core->open_links);
    +
    +    while(link) {
    +        if (link->name && qd_field_iterator_equal(name, (const unsigned 
char *)link->name))
    +            break;
    +        link = DEQ_NEXT(link);
    +    }
    +
    +    return link;
    +}
    +
    +
    +/**
    + * The body map containing any attributes that are not applicable for the 
entity being updated
    + * MUST result in a failure response with a statusCode of 400 (Bad 
Request).
    + * TODO - Generalize this function so that all update functions can use it.
    + */
    +static qd_error_t qd_is_update_request_valid(qd_router_entity_type_t  
entity_type,
    --- End diff --
    
    This seems a bit of overkill.  There's only one column that's updatable in 
this entity type.  Why allow all the non-updatable columns?


> Refactor Router Core
> --------------------
>
>                 Key: DISPATCH-179
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-179
>             Project: Qpid Dispatch
>          Issue Type: Improvement
>          Components: Router Node
>            Reporter: Ted Ross
>            Assignee: Ted Ross
>             Fix For: 0.6
>
>
> Refactor the core router function to clean up the architecture and to fix the 
> significant lock contention issue that exists in 0.5.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to