Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
5edab4f6
Commit
5edab4f6
authored
Dec 23, 2015
by
Vinogradov Aleksei
Committed by
Pavel Vainerman
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправил ошибку в парсинге строки param
parent
eebde190
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
SQLiteInterface.cc
extensions/DBServer-SQLite/SQLiteInterface.cc
+1
-1
DBInterface.cc
src/Services/DBInterface.cc
+19
-19
No files found.
extensions/DBServer-SQLite/SQLiteInterface.cc
View file @
5edab4f6
...
...
@@ -56,10 +56,10 @@ bool SQLiteInterface::connect( const std::string& param )
{
std
::
string
dbfile
;
std
::
string
::
size_type
pos
=
param
.
find_first_of
(
":"
);
dbfile
=
param
.
substr
(
0
,
pos
);
if
(
pos
!=
std
::
string
::
npos
)
{
dbfile
=
param
.
substr
(
0
,
pos
);
std
::
string
create_str
=
param
.
substr
(
pos
+
1
,
std
::
string
::
npos
);
if
(
create_str
==
"true"
)
...
...
src/Services/DBInterface.cc
View file @
5edab4f6
...
...
@@ -2,34 +2,34 @@
// ------------------------------------------------------------------------------------------
bool
DBNetInterface
::
connect
(
const
std
::
string
&
param
)
{
std
::
string
host
;
std
::
string
user
;
std
::
string
pswd
;
std
::
string
dbname
;
std
::
string
host
=
""
;
std
::
string
user
=
""
;
std
::
string
pswd
=
""
;
std
::
string
dbname
=
""
;
for
(;;)
{
std
::
string
::
size_type
pos
=
param
.
find_first_of
(
"@"
);
std
::
string
::
size_type
prev
=
0
;
user
=
param
.
substr
(
0
,
pos
);
if
(
pos
==
std
::
string
::
npos
)
break
;
if
(
pos
!=
std
::
string
::
npos
)
user
=
param
.
substr
(
prev
,
pos
);
prev
=
pos
+
1
;
std
::
string
::
size_type
prev
=
pos
+
1
;
pos
=
param
.
find_first_of
(
":"
,
prev
);
if
(
pos
!
=
std
::
string
::
npos
)
host
=
param
.
substr
(
prev
,
pos
)
;
host
=
param
.
substr
(
prev
,
pos
-
prev
);
if
(
pos
=
=
std
::
string
::
npos
)
break
;
prev
=
pos
+
1
;
pos
=
param
.
find_first_of
(
":"
,
prev
);
if
(
pos
!
=
std
::
string
::
npos
)
pswd
=
param
.
substr
(
prev
,
pos
)
;
pswd
=
param
.
substr
(
prev
,
pos
-
prev
);
if
(
pos
=
=
std
::
string
::
npos
)
break
;
prev
=
pos
+
1
;
pos
=
param
.
find_first_of
(
":"
,
prev
);
if
(
pos
!=
std
::
string
::
npos
)
dbname
=
param
.
substr
(
prev
,
pos
);
dbname
=
param
.
substr
(
prev
,
pos
-
prev
);
break
;
}
return
nconnect
(
host
,
user
,
pswd
,
dbname
);
}
//--------------------------------------------------------------------------------------------
...
...
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