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
2014-04-15 11:19:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1ae9178605c5e5da8bc01177effdca72d1bc1bda
1ae91786
1 parent
b1877db4
add favicon.ico, change to 0.9.65
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
64 行增加
和
32 行删除
trunk/auto/depends.sh
trunk/research/api-server/static-dir/favicon.ico
trunk/src/app/srs_app_http.cpp
trunk/src/app/srs_app_http.hpp
trunk/src/app/srs_app_http_conn.cpp
trunk/src/core/srs_core.hpp
trunk/auto/depends.sh
查看文件 @
1ae9178
...
...
@@ -365,6 +365,10 @@ ln -sf `pwd`/research/players ${SRS_OBJS}/nginx/html/players &&
rm -f
${
SRS_OBJS
}
/nginx/crossdomain.xml
&&
ln -sf
`
pwd
`
/research/players/crossdomain.xml
${
SRS_OBJS
}
/nginx/html/crossdomain.xml
# for favicon.ico
rm -rf
${
SRS_OBJS
}
/nginx/html/favicon.ico
&&
ln -sf
`
pwd
`
/research/api-server/static-dir/favicon.ico
${
SRS_OBJS
}
/nginx/html/favicon.ico
# nginx.html to detect whether nginx is alive
echo
"nginx is ok"
>
${
SRS_OBJS
}
/nginx/html/nginx.html
...
...
trunk/research/api-server/static-dir/favicon.ico
0 → 100644
查看文件 @
1ae9178
不能预览此文件类型
trunk/src/app/srs_app_http.cpp
查看文件 @
1ae9178
...
...
@@ -116,7 +116,7 @@ int SrsHttpHandler::process_request(SrsSocket* skt, SrsHttpMessage* req)
return
do_process_request
(
skt
,
req
);
}
bool
SrsHttpHandler
::
is_handler_valid
(
SrsHttpMessage
*
req
,
int
&
status_code
,
st
d
::
st
ring
&
reason_phrase
)
bool
SrsHttpHandler
::
is_handler_valid
(
SrsHttpMessage
*
req
,
int
&
status_code
,
string
&
reason_phrase
)
{
if
(
!
req
->
match
()
->
unmatched_url
.
empty
())
{
status_code
=
HTTP_NotFound
;
...
...
@@ -203,83 +203,90 @@ int SrsHttpHandler::best_match(const char* path, int length, SrsHttpHandlerMatch
return
ret
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_status_line
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_status_line
(
stringstream
&
ss
)
{
ss
<<
"HTTP/1.1 200 OK "
<<
__CRLF
<<
"Server: SRS/"
RTMP_SIG_SRS_VERSION
""
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_status_line_error
(
st
d
::
stringstream
&
ss
,
int
code
,
std
::
string
reason_phrase
)
SrsHttpHandler
*
SrsHttpHandler
::
res_status_line_error
(
st
ringstream
&
ss
,
int
code
,
string
reason_phrase
)
{
ss
<<
"HTTP/1.1 "
<<
code
<<
" "
<<
reason_phrase
<<
__CRLF
<<
"Server: SRS/"
RTMP_SIG_SRS_VERSION
""
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: text/html;charset=utf-8"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_xml
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_xml
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: text/xml;charset=utf-8"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_javascript
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_javascript
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: text/javascript
;charset=utf-8
"
<<
__CRLF
ss
<<
"Content-Type: text/javascript"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_swf
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_swf
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: application/x-shockwave-flash
;charset=utf-8
"
<<
__CRLF
ss
<<
"Content-Type: application/x-shockwave-flash"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_css
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_css
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: text/css;charset=utf-8"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_json
(
std
::
stringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_ico
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: image/x-icon"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_json
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: application/json;charset=utf-8"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_m3u8
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_m3u8
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: application/x-mpegURL;charset=utf-8"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_mpegts
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_type_mpegts
(
stringstream
&
ss
)
{
ss
<<
"Content-Type: video/MP2T
;charset=utf-8
"
<<
__CRLF
ss
<<
"Content-Type: video/MP2T"
<<
__CRLF
<<
"Allow: DELETE, GET, HEAD, OPTIONS, POST, PUT"
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_content_length
(
st
d
::
st
ringstream
&
ss
,
int64_t
length
)
SrsHttpHandler
*
SrsHttpHandler
::
res_content_length
(
stringstream
&
ss
,
int64_t
length
)
{
ss
<<
"Content-Length: "
<<
length
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_enable_crossdomain
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_enable_crossdomain
(
stringstream
&
ss
)
{
ss
<<
"Access-Control-Allow-Origin: *"
<<
__CRLF
<<
"Access-Control-Allow-Methods: "
...
...
@@ -289,19 +296,19 @@ SrsHttpHandler* SrsHttpHandler::res_enable_crossdomain(std::stringstream& ss)
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_header_eof
(
st
d
::
st
ringstream
&
ss
)
SrsHttpHandler
*
SrsHttpHandler
::
res_header_eof
(
stringstream
&
ss
)
{
ss
<<
__CRLF
;
return
this
;
}
SrsHttpHandler
*
SrsHttpHandler
::
res_body
(
st
d
::
stringstream
&
ss
,
std
::
string
body
)
SrsHttpHandler
*
SrsHttpHandler
::
res_body
(
st
ringstream
&
ss
,
string
body
)
{
ss
<<
body
;
return
this
;
}
int
SrsHttpHandler
::
res_flush
(
SrsSocket
*
skt
,
st
d
::
st
ringstream
&
ss
)
int
SrsHttpHandler
::
res_flush
(
SrsSocket
*
skt
,
stringstream
&
ss
)
{
return
skt
->
write
(
ss
.
str
().
c_str
(),
ss
.
str
().
length
(),
NULL
);
}
...
...
@@ -317,7 +324,7 @@ int SrsHttpHandler::res_options(SrsSocket* skt)
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_text
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
st
d
::
st
ring
body
)
int
SrsHttpHandler
::
res_text
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -334,7 +341,7 @@ int SrsHttpHandler::res_text(SrsSocket* skt, SrsHttpMessage* req, std::string bo
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_xml
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
st
d
::
st
ring
body
)
int
SrsHttpHandler
::
res_xml
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -351,7 +358,7 @@ int SrsHttpHandler::res_xml(SrsSocket* skt, SrsHttpMessage* req, std::string bod
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_javascript
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
st
d
::
st
ring
body
)
int
SrsHttpHandler
::
res_javascript
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -368,7 +375,7 @@ int SrsHttpHandler::res_javascript(SrsSocket* skt, SrsHttpMessage* req, std::str
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_swf
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
st
d
::
st
ring
body
)
int
SrsHttpHandler
::
res_swf
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -385,7 +392,7 @@ int SrsHttpHandler::res_swf(SrsSocket* skt, SrsHttpMessage* req, std::string bod
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_css
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
st
d
::
st
ring
body
)
int
SrsHttpHandler
::
res_css
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -402,7 +409,24 @@ int SrsHttpHandler::res_css(SrsSocket* skt, SrsHttpMessage* req, std::string bod
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_m3u8
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
body
)
int
SrsHttpHandler
::
res_ico
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
res_status_line
(
ss
)
->
res_content_type_ico
(
ss
)
->
res_content_length
(
ss
,
(
int
)
body
.
length
());
if
(
req
->
requires_crossdomain
())
{
res_enable_crossdomain
(
ss
);
}
res_header_eof
(
ss
)
->
res_body
(
ss
,
body
);
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_m3u8
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -419,7 +443,7 @@ int SrsHttpHandler::res_m3u8(SrsSocket* skt, SrsHttpMessage* req, std::string bo
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_mpegts
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
st
d
::
st
ring
body
)
int
SrsHttpHandler
::
res_mpegts
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -436,7 +460,7 @@ int SrsHttpHandler::res_mpegts(SrsSocket* skt, SrsHttpMessage* req, std::string
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_json
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
st
d
::
st
ring
json
)
int
SrsHttpHandler
::
res_json
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
string
json
)
{
std
::
stringstream
ss
;
...
...
@@ -453,7 +477,7 @@ int SrsHttpHandler::res_json(SrsSocket* skt, SrsHttpMessage* req, std::string js
return
res_flush
(
skt
,
ss
);
}
int
SrsHttpHandler
::
res_error
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
int
code
,
st
d
::
string
reason_phrase
,
std
::
string
body
)
int
SrsHttpHandler
::
res_error
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
int
code
,
st
ring
reason_phrase
,
string
body
)
{
std
::
stringstream
ss
;
...
...
@@ -577,7 +601,7 @@ bool SrsHttpMessage::requires_crossdomain()
return
_requires_crossdomain
;
}
void
SrsHttpMessage
::
set_url
(
st
d
::
st
ring
url
)
void
SrsHttpMessage
::
set_url
(
string
url
)
{
_url
=
url
;
}
...
...
@@ -789,7 +813,7 @@ SrsHttpUri::~SrsHttpUri()
{
}
int
SrsHttpUri
::
initialize
(
st
d
::
st
ring
_url
)
int
SrsHttpUri
::
initialize
(
string
_url
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -856,7 +880,7 @@ const char* SrsHttpUri::get_query()
return
path
.
data
();
}
st
d
::
string
SrsHttpUri
::
get_uri_field
(
std
::
string
uri
,
http_parser_url
*
hp_u
,
http_parser_url_fields
field
)
st
ring
SrsHttpUri
::
get_uri_field
(
string
uri
,
http_parser_url
*
hp_u
,
http_parser_url_fields
field
)
{
if
((
hp_u
->
field_set
&
(
1
<<
field
))
==
0
){
return
""
;
...
...
trunk/src/app/srs_app_http.hpp
查看文件 @
1ae9178
...
...
@@ -237,6 +237,7 @@ public:
virtual
SrsHttpHandler
*
res_content_type_javascript
(
std
::
stringstream
&
ss
);
virtual
SrsHttpHandler
*
res_content_type_swf
(
std
::
stringstream
&
ss
);
virtual
SrsHttpHandler
*
res_content_type_css
(
std
::
stringstream
&
ss
);
virtual
SrsHttpHandler
*
res_content_type_ico
(
std
::
stringstream
&
ss
);
virtual
SrsHttpHandler
*
res_content_type_json
(
std
::
stringstream
&
ss
);
virtual
SrsHttpHandler
*
res_content_type_m3u8
(
std
::
stringstream
&
ss
);
virtual
SrsHttpHandler
*
res_content_type_mpegts
(
std
::
stringstream
&
ss
);
...
...
@@ -252,6 +253,7 @@ public:
virtual
int
res_javascript
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
body
);
virtual
int
res_swf
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
body
);
virtual
int
res_css
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
body
);
virtual
int
res_ico
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
body
);
virtual
int
res_m3u8
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
body
);
virtual
int
res_mpegts
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
body
);
virtual
int
res_json
(
SrsSocket
*
skt
,
SrsHttpMessage
*
req
,
std
::
string
json
);
...
...
trunk/src/app/srs_app_http_conn.cpp
查看文件 @
1ae9178
...
...
@@ -202,6 +202,8 @@ int SrsHttpVhost::do_process_request(SrsSocket* skt, SrsHttpMessage* req)
return
res_swf
(
skt
,
req
,
str
);
}
else
if
(
srs_string_ends_with
(
fullpath
,
".css"
))
{
return
res_css
(
skt
,
req
,
str
);
}
else
if
(
srs_string_ends_with
(
fullpath
,
".ico"
))
{
return
res_ico
(
skt
,
req
,
str
);
}
else
{
return
res_text
(
skt
,
req
,
str
);
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
1ae9178
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "6
4
"
#define VERSION_REVISION "6
5
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
请
注册
或
登录
后发表评论