Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
7096dd73
Commit
7096dd73
authored
1 year ago
by
Roman Khlopkov
🔜
Browse files
Options
Downloads
Plain Diff
Merge branch 'bugfix-8567' into 'release-5.2'
Bugfix 8567 See merge request
!1076
parents
9182325b
36cd548c
No related branches found
No related tags found
1 merge request
!1076
Bugfix 8567
Pipeline
#25929
failed with stage
in 5 minutes and 58 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dap-sdk
+1
-1
1 addition, 1 deletion
dap-sdk
modules/common/include/dap_chain_common.h
+19
-0
19 additions, 0 deletions
modules/common/include/dap_chain_common.h
modules/net/srv/dap_chain_net_srv.c
+3
-3
3 additions, 3 deletions
modules/net/srv/dap_chain_net_srv.c
with
23 additions
and
4 deletions
dap-sdk
@
a5e0725c
Compare
d33c3b2e
...
a5e0725c
Subproject commit
d33c3b2e4cc52937947bc428f377b789fef12f15
Subproject commit
a5e0725cef9ddc54c059fd948db93d9ffd52949c
This diff is collapsed.
Click to expand it.
modules/common/include/dap_chain_common.h
+
19
−
0
View file @
7096dd73
...
...
@@ -33,6 +33,7 @@
#include
"dap_sign.h"
#include
"dap_hash.h"
#include
<json-c/json.h>
#include
"dap_strfuncs.h"
#define DAP_CHAIN_ADDR_VERSION_CURRENT 1
...
...
@@ -86,6 +87,24 @@ typedef union dap_chain_node_addr {
#define NODE_ADDR_FPS_ARGS_S(a) &a.words[3],&a.words[2],&a.words[1],&a.words[0]
#endif
DAP_STATIC_INLINE
bool
dap_chain_node_addr_str_check
(
const
char
*
a_addr_str
)
{
size_t
l_str_len
=
dap_strlen
(
a_addr_str
);
if
(
l_str_len
==
22
)
{
for
(
int
n
=
0
;
n
<
22
;
n
+=
6
)
{
if
(
!
dap_is_xdigit
(
a_addr_str
[
n
])
||
!
dap_is_xdigit
(
a_addr_str
[
n
+
1
])
||
!
dap_is_xdigit
(
a_addr_str
[
n
+
2
])
||
!
dap_is_xdigit
(
a_addr_str
[
n
+
3
]))
{
return
false
;
}
}
for
(
int
n
=
4
;
n
<
18
;
n
+=
6
)
{
if
(
a_addr_str
[
n
]
!=
':'
||
a_addr_str
[
n
+
1
]
!=
':'
)
return
false
;
}
return
true
;
}
return
false
;
}
DAP_STATIC_INLINE
int
dap_chain_node_addr_from_str
(
dap_chain_node_addr_t
*
a_addr
,
const
char
*
a_addr_str
)
{
if
(
sscanf
(
a_addr_str
,
NODE_ADDR_FP_STR
,
NODE_ADDR_FPS_ARGS
(
a_addr
))
==
4
)
...
...
This diff is collapsed.
Click to expand it.
modules/net/srv/dap_chain_net_srv.c
+
3
−
3
View file @
7096dd73
...
...
@@ -497,9 +497,9 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
l_expires
=
(
dap_time_t
)
atoll
(
l_expires_str
);
l_srv_uid
.
uint64
=
(
uint64_t
)
atoll
(
l_srv_uid_str
);
if
(
l_node_addr_str
){
if
(
dap_chain_node_addr_
from_str
(
&
l_node_addr
,
l_node_addr_str
)
==
0
)
log_it
(
L_DEBUG
,
"
node
addr
"
NODE_ADDR_FP_STR
,
NODE_ADDR_FP_ARGS_S
(
l_node_addr
)
);
else
{
if
(
dap_chain_node_addr_
str_check
(
l_node_addr_str
))
{
dap_chain_node_addr_from_str
(
&
l_
node
_
addr
,
l_node_addr
_str
);
}
else
{
log_it
(
L_ERROR
,
"Can't parse
\"
%s
\"
as node addr"
,
l_node_addr_str
);
dap_cli_server_cmd_set_reply_text
(
a_str_reply
,
"The order has not been created. "
"Failed to convert string representation of '%s' "
...
...
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