Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
930772fe
Commit
930772fe
authored
Sep 22, 2018
by
vagrant
Browse files
Bug fixed on codec search
parent
4bc40900
Changes
1
Hide whitespace changes
Inline
Side-by-side
ccsrc/Protocols/Http/http_codec.cc
View file @
930772fe
...
...
@@ -375,8 +375,6 @@ int http_codec::decode_header(CHARSTRING& header_line, LibItsHttp__TypesAndValue
int
http_codec
::
encode_body
(
const
LibItsHttp__MessageBodyTypes
::
HttpMessageBody
&
p_message_body
,
OCTETSTRING
&
p_encoding_buffer
,
const
std
::
string
&
p_content_type
)
{
loggers
::
get_instance
().
log_msg
(
">>> http_codec::encode_body: "
,
(
const
Base_Type
&
)
p_message_body
);
loggers
::
get_instance
().
log
(
"http_codec::encode_body: # of codecs=%d - %p"
,
_codecs
.
size
(),
this
);
loggers
::
get_instance
().
log
(
"http_codec::encode_body: Content-type:'%s'"
,
p_content_type
.
c_str
());
// Sanity check
if
(
p_content_type
.
empty
())
{
...
...
@@ -391,7 +389,7 @@ int http_codec::encode_body(const LibItsHttp__MessageBodyTypes::HttpMessageBody&
}
else
{
std
::
map
<
std
::
string
,
std
::
unique_ptr
<
codec
<
Record_Type
,
Record_Type
>
>
>::
const_iterator
it
;
bool
processed
=
false
;
if
(
p_content_type
.
find
_first_of
(
"x-its"
)
!=
std
::
string
::
npos
)
{
if
(
p_content_type
.
find
(
"x-its"
)
!=
std
::
string
::
npos
)
{
it
=
_codecs
.
find
(
"http_its"
);
// TODO Use params
if
(
it
!=
_codecs
.
cend
())
{
loggers
::
get_instance
().
log
(
"http_codec::encode_body: Call 'http_etsi_ieee1609dot2_codec'"
);
...
...
@@ -415,14 +413,16 @@ int http_codec::encode_body(const LibItsHttp__MessageBodyTypes::HttpMessageBody&
}
else
{
std
::
map
<
std
::
string
,
std
::
unique_ptr
<
codec
<
Record_Type
,
Record_Type
>
>
>::
const_iterator
it
;
bool
processed
=
false
;
if
(
p_content_type
.
find_first_of
(
"held"
)
!=
std
::
string
::
npos
)
{
loggers
::
get_instance
().
log
(
"http_codec::encode_body: # of codecs=%d - %p"
,
_codecs
.
size
(),
this
);
loggers
::
get_instance
().
log
(
"http_codec::encode_body: Content-type:'%s'"
,
p_content_type
.
c_str
());
if
(
p_content_type
.
find
(
"held"
)
!=
std
::
string
::
npos
)
{
it
=
_codecs
.
find
(
"held"
);
// TODO Use params
if
(
it
!=
_codecs
.
cend
())
{
loggers
::
get_instance
().
log
(
"http_codec::encode_body: Call 'held_codec'"
);
_codecs
[
"held"
]
->
encode
((
Record_Type
&
)
xml_body
,
p_encoding_buffer
);
// TODO Use params
processed
=
true
;
}
}
else
if
(
p_content_type
.
find
_first_of
(
"lost"
)
!=
std
::
string
::
npos
)
{
}
else
if
(
p_content_type
.
find
(
"lost"
)
!=
std
::
string
::
npos
)
{
it
=
_codecs
.
find
(
"lost"
);
// TODO Use params
if
(
it
!=
_codecs
.
cend
())
{
loggers
::
get_instance
().
log
(
"http_codec::encode_body: Call 'lost_codec'"
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment