Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
J
2015-04-17 10:12:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
56f75cbbe9a7734b15998853c65b9a94d9cb5cce
56f75cbb
1 parent
22ca4635
fix #384
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
6 行增加
和
7 行删除
trunk/src/app/srs_app_http.cpp
trunk/src/app/srs_app_http.hpp
trunk/src/app/srs_app_http.cpp
查看文件 @
56f75cb
...
...
@@ -1401,7 +1401,7 @@ int SrsHttpParser::parse_message(SrsStSocket* skt, SrsHttpMessage** ppmsg)
header
=
http_parser
();
url
=
""
;
headers
.
clear
();
body
_parsed
=
0
;
header
_parsed
=
0
;
// do parse
if
((
ret
=
parse_message_imp
(
skt
))
!=
ERROR_SUCCESS
)
{
...
...
@@ -1437,12 +1437,12 @@ int SrsHttpParser::parse_message_imp(SrsStSocket* skt)
// when buffer not empty, parse it.
if
(
buffer
->
size
()
>
0
)
{
nparsed
=
http_parser_execute
(
&
parser
,
&
settings
,
buffer
->
bytes
(),
buffer
->
size
());
srs_info
(
"buffer=%d, nparsed=%d,
body=%d"
,
buffer
->
size
(),
(
int
)
nparsed
,
body
_parsed
);
srs_info
(
"buffer=%d, nparsed=%d,
header=%d"
,
buffer
->
size
(),
(
int
)
nparsed
,
header
_parsed
);
}
// consume the parsed bytes.
if
(
nparsed
&&
nparsed
-
body_parsed
>
0
)
{
buffer
->
read_slice
((
int
)
nparsed
-
(
int
)
body_parsed
);
if
(
nparsed
&&
nparsed
-
header_parsed
>
0
)
{
buffer
->
read_slice
(
header_parsed
);
}
// ok atleast header completed,
...
...
@@ -1491,6 +1491,7 @@ int SrsHttpParser::on_headers_complete(http_parser* parser)
obj
->
header
=
*
parser
;
// save the parser when header parse completed.
obj
->
state
=
SrsHttpParseStateHeaderComplete
;
obj
->
header_parsed
=
(
int
)
parser
->
nread
;
srs_info
(
"***HEADERS COMPLETE***"
);
...
...
@@ -1567,8 +1568,6 @@ int SrsHttpParser::on_body(http_parser* parser, const char* at, size_t length)
SrsHttpParser
*
obj
=
(
SrsHttpParser
*
)
parser
->
data
;
srs_assert
(
obj
);
obj
->
body_parsed
+=
length
;
srs_info
(
"Body: %.*s"
,
(
int
)
length
,
at
);
return
0
;
...
...
trunk/src/app/srs_app_http.hpp
查看文件 @
56f75cb
...
...
@@ -599,7 +599,7 @@ private:
http_parser
header
;
std
::
string
url
;
std
::
vector
<
SrsHttpHeaderField
>
headers
;
int
body
_parsed
;
int
header
_parsed
;
public
:
SrsHttpParser
();
virtual
~
SrsHttpParser
();
...
...
请
注册
或
登录
后发表评论