Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/adaptors/adaptor_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,12 @@ qd_listener_oper_status_t qd_adaptor_listener_oper_status(const qd_adaptor_liste

char *qd_adaptor_listener_error_message(const qd_adaptor_listener_t *li)
{
char *value = 0;
assert(li);
sys_mutex_lock((sys_mutex_t *) &li->lock);
char *value = li->error_message;
if (!!li->error_message) {
value = qd_strdup(li->error_message);
}
sys_mutex_unlock((sys_mutex_t *) &li->lock);
return value;
}
Expand Down
3 changes: 2 additions & 1 deletion src/adaptors/adaptor_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ void qd_adaptor_listener_close(qd_adaptor_listener_t *listener);
//
qd_listener_oper_status_t qd_adaptor_listener_oper_status(const qd_adaptor_listener_t *listener);

// Get the error string from the listener
// Get the error string from the listener - The returned string (if not NULL) has been allocated and must
// be freed by the caller.
//
char *qd_adaptor_listener_error_message(const qd_adaptor_listener_t *listener);

Expand Down
2 changes: 2 additions & 0 deletions src/adaptors/tcp/tcp_adaptor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2563,9 +2563,11 @@ QD_EXPORT qd_error_t qd_entity_refresh_tcpListener(qd_entity_t* entity, void *im
&& qd_entity_set_string(entity, "operStatus", os == QD_LISTENER_OPER_UP ? "up" : "down") == 0
&& qd_entity_set_string(entity, "connectionMsg", msg ? msg : "") == 0)
{
free(msg);
return QD_ERROR_NONE;
}

free(msg);
return qd_error_code();
}

Expand Down
Loading