Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
6c999d86
Commit
6c999d86
authored
Aug 15, 2023
by
Amna Snene
Committed by
Adrien Béraud
Aug 15, 2023
Browse files
Options
Downloads
Patches
Plain Diff
connectionmanager: add deviceId to getConnectionList
Change-Id: I20a08723ae90cb8daf1b35bf7cbbea44ef067dca
parent
6b6a5d30
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/connectionmanager.h
+2
-1
2 additions, 1 deletion
include/connectionmanager.h
src/connectionmanager.cpp
+5
-3
5 additions, 3 deletions
src/connectionmanager.cpp
with
7 additions
and
4 deletions
include/connectionmanager.h
+
2
−
1
View file @
6c999d86
...
@@ -221,7 +221,8 @@ public:
...
@@ -221,7 +221,8 @@ public:
* Note: The connections are represented as maps with string keys and string values. The map
* Note: The connections are represented as maps with string keys and string values. The map
* contains the following key-value pairs:
* contains the following key-value pairs:
* - "id": The unique identifier of the connection.
* - "id": The unique identifier of the connection.
* - "userUri": The user URI associated with the connection (if available).
* - "peer": The contact URI associated with the connection (if available).
* - "device": The device URI associated with the connection.
* - "status": The status of the connection, represented as an integer:
* - "status": The status of the connection, represented as an integer:
* - 0: ConnectionStatus::Connected
* - 0: ConnectionStatus::Connected
* - 1: ConnectionStatus::TLS
* - 1: ConnectionStatus::TLS
...
...
This diff is collapsed.
Click to expand it.
src/connectionmanager.cpp
+
5
−
3
View file @
6c999d86
...
@@ -1783,9 +1783,11 @@ ConnectionManager::getConnectionList(const DeviceId& device) const
...
@@ -1783,9 +1783,11 @@ ConnectionManager::getConnectionList(const DeviceId& device) const
continue
;
continue
;
std
::
map
<
std
::
string
,
std
::
string
>
connectionInfo
;
std
::
map
<
std
::
string
,
std
::
string
>
connectionInfo
;
connectionInfo
[
"id"
]
=
callbackIdToString
(
key
.
first
,
key
.
second
);
connectionInfo
[
"id"
]
=
callbackIdToString
(
key
.
first
,
key
.
second
);
if
(
ci
->
tls_
&&
ci
->
tls_
->
peerCertificate
())
{
connectionInfo
[
"device"
]
=
key
.
first
;
auto
cert
=
ci
->
tls_
->
peerCertificate
();
if
(
ci
->
tls_
)
{
connectionInfo
[
"userUri"
]
=
cert
->
issuer
->
getId
().
toString
();
if
(
auto
cert
=
ci
->
tls_
->
peerCertificate
())
{
connectionInfo
[
"peer"
]
=
cert
->
issuer
->
getId
().
toString
();
}
}
}
if
(
ci
->
socket_
)
{
if
(
ci
->
socket_
)
{
connectionInfo
[
"status"
]
=
std
::
to_string
(
static_cast
<
int
>
(
ConnectionStatus
::
Connected
));
connectionInfo
[
"status"
]
=
std
::
to_string
(
static_cast
<
int
>
(
ConnectionStatus
::
Connected
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment