qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ted-ross <...@git.apache.org>
Subject [GitHub] qpid-dispatch pull request #125: DISPATCH-557 - Moved management of connecti...
Date Tue, 13 Dec 2016 18:37:54 GMT
Github user ted-ross commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/125#discussion_r92234597
  
    --- Diff: src/router_core/agent_connection.c ---
    @@ -0,0 +1,344 @@
    +/*
    + * 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 <qpid/dispatch/ctools.h>
    +#include "agent_connection.h"
    +#include <inttypes.h>
    +#include <stdio.h>
    +
    +#define QDR_CONNECTION_IDENTITY         0
    +#define QDR_CONNECTION_HOST             1
    +#define QDR_CONNECTION_ROLE             2
    +#define QDR_CONNECTION_DIR              3
    +#define QDR_CONNECTION_CONTAINER_ID     4
    +#define QDR_CONNECTION_SASL_MECHANISMS  5
    +#define QDR_CONNECTION_IS_AUTHENTICATED 6
    +#define QDR_CONNECTION_USER             7
    +#define QDR_CONNECTION_IS_ENCRYPTED     8
    +#define QDR_CONNECTION_SSLPROTO         9
    +#define QDR_CONNECTION_SSLCIPHER        10
    +#define QDR_CONNECTION_PROPERTIES       11
    +#define QDR_CONNECTION_SSLSSF           12
    +
    +const char *qdr_connection_columns[] =
    +    {"identity",
    +     "host",
    +     "role",
    +     "dir",
    +     "container",
    +     "sasl",
    +     "isAuthenticated",
    +     "user",
    +     "isEncrypted",
    +     "sslProto",
    +     "sslCipher",
    +     "properties",
    +     "sslSsf",
    +     0};
    +
    +const char *CONFIG_CONNECTION_TYPE = "org.apache.qpid.dispatch.connection";
    +
    +
    +static void qd_get_next_pn_data(pn_data_t **data, const char **d, int *d1)
    +{
    +    if (pn_data_next(*data)) {
    +        switch (pn_data_type(*data)) {
    +            case PN_STRING:
    +                *d = pn_data_get_string(*data).start;
    +                break;
    +            case PN_SYMBOL:
    +                *d = pn_data_get_symbol(*data).start;
    +                break;
    +            case PN_INT:
    +                *d1 = pn_data_get_int(*data);
    +                break;
    +            default:
    +                break;
    +        }
    +    }
    +    }
    +
    +
    +static void qdr_connection_insert_column_CT(qdr_connection_t *conn, int col, qd_composed_field_t
*body, bool as_map)
    +{
    +    char id_str[100];
    +
    +    if (as_map)
    +        qd_compose_insert_string(body, qdr_connection_columns[col]);
    +
    +    switch(col) {
    +    case QDR_CONNECTION_IDENTITY: {
    +        snprintf(id_str, 100, "%"PRId64, conn->identity);
    +        qd_compose_insert_string(body, id_str);
    +        break;
    +    }
    +
    +    case QDR_CONNECTION_HOST:
    +        qd_compose_insert_string(body, conn->connection_info->host);
    +        break;
    +
    +    case QDR_CONNECTION_ROLE:
    +        qd_compose_insert_string(body, conn->connection_info->role);
    +        break;
    +
    +    case QDR_CONNECTION_DIR:
    +        qd_compose_insert_string(body, conn->connection_info->dir);
    +        break;
    +
    +    case QDR_CONNECTION_CONTAINER_ID:
    +        if (conn->connection_info->container)
    +            qd_compose_insert_string(body, conn->connection_info->container);
    +        else
    +            qd_compose_insert_null(body);
    +        break;
    +
    +    case QDR_CONNECTION_SASL_MECHANISMS:
    +        qd_compose_insert_string(body, conn->connection_info->sasl_mechanisms);
    --- End diff --
    
    sasl_mechanisms is 0 if not specified.  That causes a crash here (easily reproducible
by starting the web console).  If it's not present, this should insert a NULL into the body.


---
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


Mime
View raw message