Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
43104c86
Unverified
Commit
43104c86
authored
Apr 01, 2021
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-4005 procceed errors
parent
accfcb7e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
10 deletions
+22
-10
CSRManagerServer.cpp
CSRManagerServer.cpp
+2
-1
ExitHandler.cpp
ExitHandler.cpp
+5
-2
SGXInfoServer.cpp
SGXInfoServer.cpp
+2
-1
SGXRegistrationServer.cpp
SGXRegistrationServer.cpp
+2
-1
SGXWalletServer.cpp
SGXWalletServer.cpp
+1
-1
ServerInit.cpp
ServerInit.cpp
+9
-3
ZMQServer.cpp
ZMQServer.cpp
+1
-1
No files found.
CSRManagerServer.cpp
View file @
43104c86
...
...
@@ -121,6 +121,7 @@ int CSRManagerServer::initCSRManagerServer() {
if
(
!
cs
->
StartListening
())
{
spdlog
::
info
(
"CSR manager server could not start listening"
);
ExitHandler
::
exitHandler
(
SIGTERM
,
ExitHandler
::
ec_error_starting_server
);
return
1
;
}
else
{
spdlog
::
info
(
"CSR manager server started on port {}"
,
BASE_PORT
+
2
);
}
...
...
@@ -130,7 +131,7 @@ int CSRManagerServer::initCSRManagerServer() {
int
CSRManagerServer
::
exitServer
()
{
spdlog
::
info
(
"Stoping CSRManager server"
);
if
(
!
cs
->
StopListening
())
{
if
(
cs
&&
!
cs
->
StopListening
())
{
spdlog
::
error
(
"CSRManager server could not be stopped"
);
exit
(
-
104
);
}
else
{
...
...
ExitHandler.cpp
View file @
43104c86
#include <chrono>
#include <thread>
#include "ExitHandler.h"
void
ExitHandler
::
exitHandler
(
int
s
)
{
...
...
@@ -10,8 +13,8 @@ void ExitHandler::exitHandler( int s, ExitHandler::exit_code_t ec ) {
g_ec
=
ec
;
}
s_shouldExit
=
true
;
// // HACK wait for loop in main to send exit call to consensus et al.
// std::this_thread::sleep_for( std::chrono::milliseconds( 200
0 ) );
// HACK wait for loop in main to recieve exit call
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
seconds
(
2
0
)
);
}
volatile
bool
ExitHandler
::
s_shouldExit
=
false
;
...
...
SGXInfoServer.cpp
View file @
43104c86
...
...
@@ -117,6 +117,7 @@ int SGXInfoServer::initInfoServer(uint32_t _logLevel, bool _autoSign, bool _chec
if
(
!
server
->
StartListening
())
{
spdlog
::
error
(
"Info server could not start listening on port {}"
,
BASE_PORT
+
4
);
ExitHandler
::
exitHandler
(
SIGTERM
,
ExitHandler
::
ec_error_starting_server
);
return
1
;
}
else
{
spdlog
::
info
(
"Info server started on port {}"
,
BASE_PORT
+
4
);
}
...
...
@@ -127,7 +128,7 @@ int SGXInfoServer::initInfoServer(uint32_t _logLevel, bool _autoSign, bool _chec
int
SGXInfoServer
::
exitServer
()
{
spdlog
::
info
(
"Stoping SGXInfo server"
);
if
(
!
server
->
StopListening
())
{
if
(
server
&&
!
server
->
StopListening
())
{
spdlog
::
error
(
"SGXInfo server could not be stopped"
);
exit
(
-
105
);
}
else
{
...
...
SGXRegistrationServer.cpp
View file @
43104c86
...
...
@@ -174,6 +174,7 @@ int SGXRegistrationServer::initRegistrationServer(bool _autoSign) {
if
(
!
server
->
StartListening
())
{
spdlog
::
error
(
"Registration server could not start listening on port {}"
,
BASE_PORT
+
1
);
ExitHandler
::
exitHandler
(
SIGTERM
,
ExitHandler
::
ec_error_starting_server
);
return
1
;
}
else
{
spdlog
::
info
(
"Registration server started on port {}"
,
BASE_PORT
+
1
);
}
...
...
@@ -184,7 +185,7 @@ int SGXRegistrationServer::initRegistrationServer(bool _autoSign) {
int
SGXRegistrationServer
::
exitServer
()
{
spdlog
::
info
(
"Stoping registration server"
);
if
(
!
server
->
StopListening
())
{
if
(
server
&&
!
server
->
StopListening
())
{
spdlog
::
error
(
"Registration server could not be stopped"
);
exit
(
-
102
);
}
else
{
...
...
SGXWalletServer.cpp
View file @
43104c86
...
...
@@ -222,7 +222,7 @@ int SGXWalletServer::initHttpServer() { //without ssl
int
SGXWalletServer
::
exitServer
()
{
spdlog
::
info
(
"Stoping sgx server"
);
if
(
!
server
->
StopListening
())
{
if
(
server
&&
!
server
->
StopListening
())
{
spdlog
::
error
(
"Sgx server could not be stopped"
);
exit
(
-
103
);
}
else
{
...
...
ServerInit.cpp
View file @
43104c86
...
...
@@ -212,9 +212,15 @@ void initAll(uint32_t _logLevel, bool _checkCert,
spdlog
::
info
(
"Inited JSON-RPC server over HTTP"
);
}
SGXRegistrationServer
::
initRegistrationServer
(
_autoSign
);
CSRManagerServer
::
initCSRManagerServer
();
SGXInfoServer
::
initInfoServer
(
_logLevel
,
_checkCert
,
_autoSign
,
_generateTestKeys
);
if
(
SGXRegistrationServer
::
initRegistrationServer
(
_autoSign
))
{
return
;
}
if
(
CSRManagerServer
::
initCSRManagerServer
())
{
return
;
}
if
(
SGXInfoServer
::
initInfoServer
(
_logLevel
,
_checkCert
,
_autoSign
,
_generateTestKeys
))
{
return
;
}
ZMQServer
::
initZMQServer
(
_checkZMQSig
);
sgxServerInited
=
true
;
...
...
ZMQServer.cpp
View file @
43104c86
...
...
@@ -72,7 +72,7 @@ void ZMQServer::run() {
auto
port
=
BASE_PORT
+
5
;
spdlog
::
info
(
"Starting zmq server
on port {} ..."
,
port
);
spdlog
::
info
(
"Starting zmq server on port {} ..."
,
port
);
try
{
CHECK_STATE
(
frontend
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment