Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1732: implement new Admin Connector type #1740

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kgiusti
Copy link
Contributor

@kgiusti kgiusti commented Feb 5, 2025

No description provided.

item->scheme = strdup("amqp");
item->host = strdup(admin_conn->config.host);
item->port = strdup(admin_conn->config.port);
int hplen = strlen(item->host) + strlen(item->port) + 2;

Check warning

Code scanning / GNU C11

use of possibly-NULL 'strdup(*admin_conn.config.host)' where non-null expected Warning

use of possibly-NULL 'strdup(*admin_conn.config.host)' where non-null expected
item->scheme = strdup("amqp");
item->host = strdup(admin_conn->config.host);
item->port = strdup(admin_conn->config.port);
int hplen = strlen(item->host) + strlen(item->port) + 2;

Check warning

Code scanning / GNU C11

use of possibly-NULL 'strdup(*admin_conn.config.port)' where non-null expected Warning

use of possibly-NULL 'strdup(*admin_conn.config.port)' where non-null expected
@@ -168,49 +166,53 @@ static int get_failover_info_length(qd_failover_item_list_t conn_info_list)
*/
QD_EXPORT qd_error_t qd_entity_refresh_connector(qd_entity_t* entity, void *impl)
{
qd_connector_t *connector = (qd_connector_t*) impl;
qd_admin_connector_t *admin_conn = (qd_admin_connector_t *) impl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
qd_admin_connector_t *admin_conn = (qd_admin_connector_t *) impl;
qd_admin_connector_t *admin_connector = (qd_admin_connector_t *) impl;
``
Someone might look at `admin_conn` somewhere in the code and think of it as an admin connection instead of an admin connector

o) rename qd_admin_connector_t --> qd_connector_config_t
o) change "admin_conn" to "ctor_config"
o) Use "ctor" as shorthand for "connector" in API and local vars
@kgiusti kgiusti marked this pull request as ready for review February 7, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants