Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Titan Test System Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
CTI Tools
Titan Test System Framework
Commits
7d4fc332
Commit
7d4fc332
authored
1 year ago
by
Yann Garcia
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixed in HTTP codec when Content-Length is no present
parent
6901c1c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Closing TTF T024/025
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ccsrc/Protocols/Http/http_codec.cc
+9
-3
9 additions, 3 deletions
ccsrc/Protocols/Http/http_codec.cc
with
9 additions
and
3 deletions
ccsrc/Protocols/Http/http_codec.cc
+
9
−
3
View file @
7d4fc332
...
@@ -113,6 +113,8 @@ int http_codec::decode(const OCTETSTRING &data, LibHttp__TypesAndValues::HttpMes
...
@@ -113,6 +113,8 @@ int http_codec::decode(const OCTETSTRING &data, LibHttp__TypesAndValues::HttpMes
LibHttp__TypesAndValues
::
Headers
headers
;
LibHttp__TypesAndValues
::
Headers
headers
;
std
::
string
content_type
;
std
::
string
content_type
;
decode_headers
(
decoding_buffer
,
headers
,
content_type
);
decode_headers
(
decoding_buffer
,
headers
,
content_type
);
loggers
::
get_instance
().
log
(
"http_codec::decode: _dc.length=%d"
,
_dc
.
length
);
loggers
::
get_instance
().
log
(
"http_codec::decode: decoding_buffer.get_len()=%d"
,
decoding_buffer
.
get_len
());
if
(
_dc
.
length
>
decoding_buffer
.
get_len
())
{
// HTTP response is fragmented
if
(
_dc
.
length
>
decoding_buffer
.
get_len
())
{
// HTTP response is fragmented
// Need to bufferize the first packet and wait for the other fragments tp be received
// Need to bufferize the first packet and wait for the other fragments tp be received
loggers
::
get_instance
().
warning
(
"http_codec::decode: Need to bufferize the first packet and wait for the other fragments tp be received"
);
loggers
::
get_instance
().
warning
(
"http_codec::decode: Need to bufferize the first packet and wait for the other fragments tp be received"
);
...
@@ -417,8 +419,12 @@ int http_codec::decode_headers(TTCN_Buffer &decoding_buffer, LibHttp__TypesAndVa
...
@@ -417,8 +419,12 @@ int http_codec::decode_headers(TTCN_Buffer &decoding_buffer, LibHttp__TypesAndVa
}
break
;
}
break
;
case
1
:
case
1
:
if
(
headers
.
is_bound
())
{
if
(
headers
.
is_bound
())
{
loggers
::
get_instance
().
log_msg
(
"<<< http_codec::decode_headers: "
,
headers
);
if
(
_dc
.
length
==
-
1
)
{
// content-Length header not found, force length to 0, assuming no body is present
return
0
;
loggers
::
get_instance
().
log
(
"http_codec::decode_headers: Force _dc.length to 0"
);
_dc
.
length
=
0
;
}
loggers
::
get_instance
().
log_msg
(
"<<< http_codec::decode_headers: "
,
headers
);
return
0
;
}
else
{
}
else
{
loggers
::
get_instance
().
warning
(
"http_codec::decode_headers: Failed to decode headers"
);
loggers
::
get_instance
().
warning
(
"http_codec::decode_headers: Failed to decode headers"
);
return
-
1
;
return
-
1
;
...
@@ -431,7 +437,7 @@ int http_codec::decode_headers(TTCN_Buffer &decoding_buffer, LibHttp__TypesAndVa
...
@@ -431,7 +437,7 @@ int http_codec::decode_headers(TTCN_Buffer &decoding_buffer, LibHttp__TypesAndVa
}
}
int
http_codec
::
decode_header
(
CHARSTRING
&
header_line
,
LibHttp__TypesAndValues
::
Header
&
header
)
{
int
http_codec
::
decode_header
(
CHARSTRING
&
header_line
,
LibHttp__TypesAndValues
::
Header
&
header
)
{
loggers
::
get_instance
().
log_msg
(
">>> http_codec::decode_header"
,
header_line
);
loggers
::
get_instance
().
log_msg
(
">>> http_codec::decode_header
:
"
,
header_line
);
try
{
try
{
std
::
string
str
(
static_cast
<
const
char
*>
(
header_line
));
std
::
string
str
(
static_cast
<
const
char
*>
(
header_line
));
...
...
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