gluon-mesh-vpn-fastd: Expose negotiated method
This commit is contained in:
parent
e40ed5810d
commit
bd285d9908
@ -217,7 +217,7 @@ static bool get_peer_connection(struct json_object **ret, struct json_object *co
|
|||||||
if (!key)
|
if (!key)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
struct json_object *peer, *connection, *established;
|
struct json_object *peer, *connection, *established, *method;
|
||||||
if (!json_object_object_get_ex(peers, key, &peer) ||
|
if (!json_object_object_get_ex(peers, key, &peer) ||
|
||||||
!json_object_object_get_ex(peer, "connection", &connection))
|
!json_object_object_get_ex(peer, "connection", &connection))
|
||||||
return false;
|
return false;
|
||||||
@ -229,6 +229,10 @@ static bool get_peer_connection(struct json_object **ret, struct json_object *co
|
|||||||
struct json_object *jso = json_object_new_double(established_time/1000.0);
|
struct json_object *jso = json_object_new_double(established_time/1000.0);
|
||||||
json_object_set_serializer(jso, json_object_double_to_json_string, "%.3f", NULL);
|
json_object_set_serializer(jso, json_object_double_to_json_string, "%.3f", NULL);
|
||||||
json_object_object_add(*ret, "established", jso);
|
json_object_object_add(*ret, "established", jso);
|
||||||
|
|
||||||
|
if (json_object_object_get_ex(connection, "method", &method)) {
|
||||||
|
json_object_object_add(*ret, "method", json_object_get(method));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*ret = NULL;
|
*ret = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user