Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-net-srv
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain-net-srv
Commits
eeeca81f
Commit
eeeca81f
authored
5 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[*] Small changes
parent
04e23e07
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dap_chain_net_srv.c
+5
-5
5 additions, 5 deletions
dap_chain_net_srv.c
dap_chain_net_srv.h
+2
-2
2 additions, 2 deletions
dap_chain_net_srv.h
dap_chain_net_srv_common.h
+2
-0
2 additions, 0 deletions
dap_chain_net_srv_common.h
with
9 additions
and
7 deletions
dap_chain_net_srv.c
+
5
−
5
View file @
eeeca81f
...
...
@@ -77,7 +77,7 @@ static void s_load_all(void);
* @brief dap_chain_net_srv_init
* @return
*/
int
dap_chain_net_srv_init
(
void
)
int
dap_chain_net_srv_init
(
dap_config_t
*
a_cfg
)
{
m_uid
=
NULL
;
m_uid_count
=
0
;
...
...
@@ -394,15 +394,16 @@ static int s_cli_net_srv( int argc, char **argv, char **a_str_reply)
* @param a_uid
* @param a_callback_new
*/
int
dap_chain_net_srv_add
(
dap_chain_net_srv_uid_t
a_uid
,
dap_chain_net_srv_callback_data_t
a_callback_request
)
dap_chain_net_srv_t
*
dap_chain_net_srv_add
(
dap_chain_net_srv_uid_t
a_uid
,
dap_chain_net_srv_callback_data_t
a_callback_request
)
{
int
ret
=
0
;
service_list_t
*
l_sdata
=
NULL
;
dap_chain_net_srv_t
*
l_srv
=
NULL
;
dap_chain_net_srv_uid_t
l_uid
=
{.
uint64
=
a_uid
.
uint64
};
// Copy to let then compiler to pass args via registers not stack
pthread_mutex_lock
(
&
s_srv_list_mutex
);
HASH_FIND
(
hh
,
s_srv_list
,
&
l_uid
,
sizeof
(
l_uid
),
l_sdata
);
if
(
l_sdata
==
NULL
)
{
dap_chain_net_srv_t
*
l_srv
=
DAP_NEW_Z
(
dap_chain_net_srv_t
);
l_srv
=
DAP_NEW_Z
(
dap_chain_net_srv_t
);
l_srv
->
uid
.
uint64
=
a_uid
.
uint64
;
l_srv
->
callback_requested
=
a_callback_request
;
l_sdata
=
DAP_NEW_Z
(
service_list_t
);
...
...
@@ -412,10 +413,9 @@ int dap_chain_net_srv_add(dap_chain_net_srv_uid_t a_uid,dap_chain_net_srv_callba
HASH_ADD
(
hh
,
s_srv_list
,
uid
,
sizeof
(
l_srv
->
uid
),
l_sdata
);
}
else
{
log_it
(
L_ERROR
,
"Already present service with 0x%016llX "
,
a_uid
.
uint64
);
ret
=
-
1
;
}
pthread_mutex_unlock
(
&
s_srv_list_mutex
);
return
ret
;
return
l_srv
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
dap_chain_net_srv.h
+
2
−
2
View file @
eeeca81f
...
...
@@ -47,9 +47,9 @@ typedef struct dap_chain_net_srv
typedef
void
(
*
dap_chain_net_srv_callback_new_t
)(
dap_chain_net_srv_t
*
,
dap_config_t
*
);
int
dap_chain_net_srv_init
(
void
);
int
dap_chain_net_srv_init
(
dap_config_t
*
a_cfg
);
void
dap_chain_net_srv_deinit
(
void
);
int
dap_chain_net_srv_add
(
dap_chain_net_srv_uid_t
a_uid
,
dap_chain_net_srv_callback_data_t
a_callback_request
);
dap_chain_net_srv_t
*
dap_chain_net_srv_add
(
dap_chain_net_srv_uid_t
a_uid
,
dap_chain_net_srv_callback_data_t
a_callback_request
);
void
dap_chain_net_srv_del
(
dap_chain_net_srv_t
*
a_srv
);
void
dap_chain_net_srv_del_all
(
void
);
dap_chain_net_srv_t
*
dap_chain_net_srv_get
(
dap_chain_net_srv_uid_t
a_uid
);
...
...
This diff is collapsed.
Click to expand it.
dap_chain_net_srv_common.h
+
2
−
0
View file @
eeeca81f
...
...
@@ -32,6 +32,7 @@
#include
"dap_chain_common.h"
#include
"dap_chain_ledger.h"
#include
"dap_chain_net.h"
#include
"dap_chain_wallet.h"
...
...
@@ -76,6 +77,7 @@ typedef void (*dap_chain_callback_trafic_t)(dap_client_remote_t *, dap_stream_ch
typedef
struct
dap_chain_net_srv_price
{
dap_chain_wallet_t
*
wallet
;
char
*
net_name
;
dap_chain_net_t
*
net
;
uint64_t
value_datoshi
;
...
...
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