Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
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
savoirfairelinux
jami-daemon
Commits
f930f138
Commit
f930f138
authored
14 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
[#5286] Fix parsing error due to long configuration file (removed max event)
parent
7bb3770f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-common/src/config/yamlparser.cpp
+8
-14
8 additions, 14 deletions
sflphone-common/src/config/yamlparser.cpp
sflphone-common/src/config/yamlparser.h
+4
-2
4 additions, 2 deletions
sflphone-common/src/config/yamlparser.h
with
12 additions
and
16 deletions
sflphone-common/src/config/yamlparser.cpp
+
8
−
14
View file @
f930f138
...
...
@@ -39,6 +39,8 @@ namespace Conf
{
YamlParser
::
YamlParser
(
const
char
*
file
)
:
filename
(
file
)
,
fd
(
NULL
)
,
events
()
,
eventNumber
(
0
)
,
doc
(
NULL
)
,
eventIndex
(
0
)
...
...
@@ -97,7 +99,7 @@ void YamlParser::close() throw(YamlParserException)
void
YamlParser
::
serializeEvents
()
throw
(
YamlParserException
)
{
bool
done
=
false
;
yaml_event_t
event
;
yaml_event_t
event
,
copiedEvent
;
try
{
...
...
@@ -108,16 +110,16 @@ void YamlParser::serializeEvents() throw(YamlParserException)
done
=
(
event
.
type
==
YAML_STREAM_END_EVENT
);
if
(
eventNumber
>
PARSER_MAXEVENT
)
throw
YamlParserException
(
"Reached maximum of event"
);
copyEvent
(
&
copiedEvent
,
&
event
);
copyEvent
(
&
(
events
[
eventNumber
++
]),
&
event
);
events
.
push_back
(
copiedEvent
);
eventNumber
++
;
yaml_event_delete
(
&
event
);
}
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException: %s"
,
e
.
what
());
throw
;
}
...
...
@@ -233,7 +235,6 @@ YamlDocument *YamlParser::composeEvents() throw(YamlParserException)
processStream
();
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException: %s"
,
e
.
what
());
throw
;
}
...
...
@@ -255,8 +256,7 @@ void YamlParser::processStream () throw(YamlParserException)
if
(
events
[
eventIndex
].
type
!=
YAML_STREAM_END_EVENT
)
throw
YamlParserException
(
"Did not found end of stream"
);
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException: %s"
,
e
.
what
());
catch
(
YamlParserException
&
e
)
{
throw
;
}
}
...
...
@@ -294,7 +294,6 @@ void YamlParser::processDocument() throw(YamlParserException)
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException: %s"
,
e
.
what
());
throw
;
}
}
...
...
@@ -327,7 +326,6 @@ void YamlParser::processScalar (YamlNode *topNode) throw(YamlParserException)
}
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException %s"
,
e
.
what
());
throw
;
}
}
...
...
@@ -383,7 +381,6 @@ void YamlParser::processSequence (YamlNode *topNode) throw(YamlParserException)
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException %s"
,
e
.
what
());
throw
;
}
...
...
@@ -447,7 +444,6 @@ void YamlParser::processMapping (YamlNode *topNode) throw(YamlParserException)
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException %s"
,
e
.
what
());
throw
;
}
}
...
...
@@ -489,7 +485,6 @@ void YamlParser::constructNativeData() throw(YamlParserException)
}
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException %s"
,
e
.
what
());
throw
;
}
...
...
@@ -542,7 +537,6 @@ void YamlParser::mainNativeDataMapping (MappingNode *map) throw(YamlParserExcept
}
}
catch
(
YamlParserException
&
e
)
{
_error
(
"YamlParserException %s"
,
e
.
what
());
throw
;
}
}
...
...
This diff is collapsed.
Click to expand it.
sflphone-common/src/config/yamlparser.h
+
4
−
2
View file @
f930f138
...
...
@@ -36,12 +36,14 @@
#include
<stdio.h>
#include
<exception>
#include
<string>
#include
<vector>
namespace
Conf
{
#define PARSER_BUFFERSIZE 65536
#define PARSER_MAXEVENT 1024
typedef
std
::
vector
<
yaml_event_t
>
YamlEventVector
;
class
YamlParserException
:
public
std
::
exception
{
...
...
@@ -145,7 +147,7 @@ class YamlParser
/**
* The event structure array.
*/
y
aml
_e
vent
_t
events
[
PARSER_MAXEVENT
]
;
Y
aml
E
vent
Vector
events
;
/**
*
...
...
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