char *s = NULL;
json_t *jstr = NULL;
- if (tr_cmp_timespec(trp_peer_get_last_conn_attempt(peer), &ts_zero) == 0) {
- s = strdup("");
- } else {
+ if (tr_cmp_timespec(trp_peer_get_last_conn_attempt(peer), &ts_zero) > 0) {
s = timespec_to_str(trp_peer_get_last_conn_attempt(peer));
- }
- if (s) {
- jstr = json_string(s);
- free(s);
+ if (s) {
+ jstr = json_string(s);
+ free(s);
+ }
}
return jstr;
OBJECT_SET_OR_FAIL(peer_json, "last_connection_attempt",
last_attempt_to_json_string(peer));
OBJECT_SET_OR_FAIL(peer_json, "allowed_credentials",
- gss_names_to_json_array(trp_peer_get_gss_names(peer)));
+ tr_gss_names_to_json_array(trp_peer_get_gss_names(peer)));
+ OBJECT_SET_OR_FAIL(peer_json, "filters",
+ tr_filter_set_to_json(peer->filters));
/* succeeded - set the return value and increment the reference count */
retval = peer_json;