Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
ab5a37d2
Commit
ab5a37d2
authored
Nov 20, 2019
by
Claes Sjöfors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sev_server, mysql connect timeout increased and reconnect enabled
parent
0f119e32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
sev/lib/sev/src/sev_dbms.cpp
sev/lib/sev/src/sev_dbms.cpp
+16
-1
No files found.
sev/lib/sev/src/sev_dbms.cpp
View file @
ab5a37d2
...
...
@@ -59,6 +59,9 @@
#include "sev_dbms.h"
static
unsigned
int
mysql_timeout
=
315360000
;
static
bool
mysql_enable_reconnect
=
true
;
char
sev_dbms_env
::
m_systemName
[
40
];
sev_dbms_env
::
sev_dbms_env
(
const
char
*
v_fileName
)
...
...
@@ -276,6 +279,7 @@ int sev_dbms_env::create(const char* v_fileName, const char* v_host,
MYSQL
*
sev_dbms_env
::
createDb
(
void
)
{
if
(
mysql_library_init
(
0
,
NULL
,
NULL
))
{
printf
(
"** Cannot init mysql client library
\n
"
);
return
0
;
...
...
@@ -283,6 +287,9 @@ MYSQL* sev_dbms_env::createDb(void)
m_con
=
mysql_init
(
NULL
);
mysql_options
(
m_con
,
MYSQL_OPT_CONNECT_TIMEOUT
,
&
mysql_timeout
);
mysql_options
(
m_con
,
MYSQL_OPT_RECONNECT
,
&
mysql_enable_reconnect
);
MYSQL
*
con
=
mysql_real_connect
(
m_con
,
host
(),
user
(),
passwd
(),
0
,
port
(),
socket
(),
0
);
// printf("Tried to connect to database, con %x: Status: %s\n", (int)con,
...
...
@@ -679,6 +686,9 @@ MYSQL* sev_dbms_env::openDb(unsigned int* sts)
m_con
=
mysql_init
(
NULL
);
mysql_options
(
m_con
,
MYSQL_OPT_CONNECT_TIMEOUT
,
&
mysql_timeout
);
mysql_options
(
m_con
,
MYSQL_OPT_RECONNECT
,
&
mysql_enable_reconnect
);
MYSQL
*
con
=
mysql_real_connect
(
m_con
,
host
(),
user
(),
passwd
(),
dbName
(),
port
(),
socket
(),
0
);
if
(
con
==
0
)
{
...
...
@@ -693,6 +703,9 @@ MYSQL* sev_dbms_env::open_thread(unsigned int* sts)
{
MYSQL
*
con
=
mysql_init
(
NULL
);
mysql_options
(
con
,
MYSQL_OPT_CONNECT_TIMEOUT
,
&
mysql_timeout
);
mysql_options
(
con
,
MYSQL_OPT_RECONNECT
,
&
mysql_enable_reconnect
);
con
=
mysql_real_connect
(
con
,
host
(),
user
(),
passwd
(),
dbName
(),
port
(),
socket
(),
0
);
if
(
con
==
0
)
{
...
...
@@ -1011,7 +1024,7 @@ int sev_dbms::delete_table(pwr_tStatus* sts, char* tablename)
int
sev_dbms
::
create_event_table
(
pwr_tStatus
*
sts
,
char
*
tablename
,
pwr_tMask
options
)
{
char
query
[
5
4
0
];
char
query
[
5
8
0
];
char
timeformatstr
[
80
];
char
jumpstr
[
80
];
char
idtypestr
[
20
];
...
...
@@ -2629,6 +2642,8 @@ int sev_dbms::store_event(
if
(
!
result
)
{
printf
(
"In %s row %d:
\n
"
,
__FILE__
,
__LINE__
);
printf
(
"%s Result Error
\n
"
,
__FUNCTION__
);
*
sts
=
SEV__DBERROR
;
return
0
;
}
int
rows
=
mysql_num_rows
(
result
);
...
...
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