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
winlin
2015-06-14 19:42:43 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3211282b0c588fc7e4d0b2ad5e526eb7ee027212
3211282b
1 parent
f8f6e438
refine the http code.
显示空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
17 行增加
和
13 行删除
trunk/src/app/srs_app_hls.cpp
trunk/src/app/srs_app_http_conn.cpp
trunk/src/app/srs_app_http_conn.hpp
trunk/src/app/srs_app_server.cpp
trunk/src/app/srs_app_hls.cpp
查看文件 @
3211282
...
...
@@ -752,7 +752,7 @@ int SrsHlsMuxer::segment_close(string log_desc)
if
(
should_write_file
)
{
unlink
(
tmp_file
.
c_str
());
if
(
unlink
(
tmp_file
.
c_str
())
<
0
)
{
srs_warn
(
"
drop
unlink path failed, file=%s."
,
tmp_file
.
c_str
());
srs_warn
(
"
ignore
unlink path failed, file=%s."
,
tmp_file
.
c_str
());
}
}
...
...
trunk/src/app/srs_app_http_conn.cpp
查看文件 @
3211282
...
...
@@ -1204,26 +1204,28 @@ int SrsHttpConn::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
return
ret
;
}
Srs
StaticHttpConn
::
SrsStatic
HttpConn
(
IConnectionManager
*
cm
,
st_netfd_t
fd
,
ISrsHttpServeMux
*
m
)
Srs
ResponseOnlyHttpConn
::
SrsResponseOnly
HttpConn
(
IConnectionManager
*
cm
,
st_netfd_t
fd
,
ISrsHttpServeMux
*
m
)
:
SrsHttpConn
(
cm
,
fd
,
m
)
{
}
Srs
StaticHttpConn
::~
SrsStatic
HttpConn
()
Srs
ResponseOnlyHttpConn
::~
SrsResponseOnly
HttpConn
()
{
}
int
Srs
Static
HttpConn
::
on_got_http_message
(
ISrsHttpMessage
*
msg
)
int
Srs
ResponseOnly
HttpConn
::
on_got_http_message
(
ISrsHttpMessage
*
msg
)
{
int
ret
=
ERROR_SUCCESS
;
// TODO: FIXME: use the post body.
std
::
string
res
;
ISrsHttpResponseReader
*
br
=
msg
->
body_reader
();
// get response body.
if
((
ret
=
msg
->
body_read_all
(
res
))
!=
ERROR_SUCCESS
)
{
// drop all request body.
while
(
!
br
->
eof
())
{
char
body
[
4096
];
if
((
ret
=
br
->
read
(
body
,
4096
,
NULL
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
}
return
ret
;
}
...
...
trunk/src/app/srs_app_http_conn.hpp
查看文件 @
3211282
...
...
@@ -394,12 +394,14 @@ private:
virtual
int
process_request
(
ISrsHttpResponseWriter
*
w
,
ISrsHttpMessage
*
r
);
};
// TODO: FIXME: rename to SrsResponseOnlyHttpConn.
class
SrsStaticHttpConn
:
public
SrsHttpConn
/**
* drop body of request, only process the response.
*/
class
SrsResponseOnlyHttpConn
:
public
SrsHttpConn
{
public
:
SrsStaticHttpConn
(
IConnectionManager
*
cm
,
st_netfd_t
fd
,
ISrsHttpServeMux
*
m
);
virtual
~
SrsStaticHttpConn
();
SrsResponseOnlyHttpConn
(
IConnectionManager
*
cm
,
st_netfd_t
fd
,
ISrsHttpServeMux
*
m
);
virtual
~
SrsResponseOnlyHttpConn
();
public
:
virtual
int
on_got_http_message
(
ISrsHttpMessage
*
msg
);
};
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
3211282
...
...
@@ -1219,7 +1219,7 @@ int SrsServer::accept_client(SrsListenerType type, st_netfd_t client_stfd)
#endif
}
else
if
(
type
==
SrsListenerHttpStream
)
{
#ifdef SRS_AUTO_HTTP_SERVER
conn
=
new
Srs
Static
HttpConn
(
this
,
client_stfd
,
http_server
);
conn
=
new
Srs
ResponseOnly
HttpConn
(
this
,
client_stfd
,
http_server
);
#else
srs_warn
(
"close http client for server not support http-server"
);
srs_close_stfd
(
client_stfd
);
...
...
请
注册
或
登录
后发表评论