Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
6a8ddb34
Commit
6a8ddb34
authored
Nov 24, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: don't store http reply as member
parent
cba9fffa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
modules/stream_filter/dash/http/HTTPConnection.cpp
modules/stream_filter/dash/http/HTTPConnection.cpp
+7
-5
modules/stream_filter/dash/http/HTTPConnection.h
modules/stream_filter/dash/http/HTTPConnection.h
+8
-2
modules/stream_filter/dash/http/PersistentConnection.cpp
modules/stream_filter/dash/http/PersistentConnection.cpp
+6
-5
No files found.
modules/stream_filter/dash/http/HTTPConnection.cpp
View file @
6a8ddb34
...
...
@@ -34,8 +34,7 @@ using namespace dash::http;
HTTPConnection
::
HTTPConnection
(
stream_t
*
stream
)
:
IHTTPConnection
(
stream
),
peekBufferLen
(
0
),
contentLength
(
0
)
peekBufferLen
(
0
)
{
this
->
peekBuffer
=
new
uint8_t
[
PEEKBUFFER
];
}
...
...
@@ -84,12 +83,15 @@ std::string HTTPConnection::getRequestHeader (const Chunk *chunk) const
bool
HTTPConnection
::
init
(
Chunk
*
chunk
)
{
if
(
IHTTPConnection
::
init
(
chunk
))
return
parseHeader
();
{
HeaderReply
reply
;
return
parseHeader
(
&
reply
);
}
else
return
false
;
}
bool
HTTPConnection
::
parseHeader
()
bool
HTTPConnection
::
parseHeader
(
HeaderReply
*
reply
)
{
std
::
string
line
=
this
->
readLine
();
...
...
@@ -99,7 +101,7 @@ bool HTTPConnection::parseHeader ()
while
(
line
.
compare
(
"
\r\n
"
))
{
if
(
!
strncasecmp
(
line
.
c_str
(),
"Content-Length"
,
14
))
this
->
contentLength
=
atoi
(
line
.
substr
(
15
,
line
.
size
()).
c_str
());
reply
->
contentLength
=
atoi
(
line
.
substr
(
15
,
line
.
size
()).
c_str
());
line
=
this
->
readLine
();
...
...
modules/stream_filter/dash/http/HTTPConnection.h
View file @
6a8ddb34
...
...
@@ -49,12 +49,18 @@ namespace dash
virtual
int
peek
(
const
uint8_t
**
pp_peek
,
size_t
i_peek
);
protected:
class
HeaderReply
{
public:
int
contentLength
;
};
uint8_t
*
peekBuffer
;
size_t
peekBufferLen
;
int
contentLength
;
virtual
bool
send
(
const
std
::
string
&
data
);
bool
parseHeader
();
bool
parseHeader
(
HeaderReply
*
);
std
::
string
readLine
();
virtual
std
::
string
getRequestHeader
(
const
Chunk
*
chunk
)
const
;
/* reimpl */
};
...
...
modules/stream_filter/dash/http/PersistentConnection.cpp
View file @
6a8ddb34
...
...
@@ -130,18 +130,19 @@ bool PersistentConnection::addChunk (Chunk *chunk)
}
bool
PersistentConnection
::
initChunk
(
Chunk
*
chunk
)
{
if
(
this
->
parseHeader
())
HeaderReply
reply
;
if
(
parseHeader
(
&
reply
))
{
chunk
->
setLength
(
this
->
contentLength
);
chunk
->
setLength
(
reply
.
contentLength
);
return
true
;
}
if
(
!
this
->
reconnect
(
chunk
))
if
(
!
reconnect
(
chunk
))
return
false
;
if
(
this
->
parseHeader
(
))
if
(
parseHeader
(
&
reply
))
{
chunk
->
setLength
(
this
->
contentLength
);
chunk
->
setLength
(
reply
.
contentLength
);
return
true
;
}
...
...
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