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-07-20 13:42:29 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1afa6ed6077d8639dacdd0f10b74be472720f39d
1afa6ed6
1 parent
26678151
refine consts.
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
16 行增加
和
16 行删除
trunk/src/app/srs_app_http.cpp
trunk/src/app/srs_app_http.hpp
trunk/src/app/srs_app_http_conn.cpp
trunk/src/app/srs_app_json.cpp
trunk/src/app/srs_app_json.hpp
trunk/src/kernel/srs_kernel_consts.hpp
trunk/src/app/srs_app_http.cpp
查看文件 @
1afa6ed
...
...
@@ -169,7 +169,7 @@ int SrsHttpHandler::best_match(const char* path, int length, SrsHttpHandlerMatch
}
const
char
*
p
=
NULL
;
for
(
p
=
path
+
1
;
p
-
path
<
length
&&
*
p
!=
_
_PATH_SEP
;
p
++
)
{
for
(
p
=
path
+
1
;
p
-
path
<
length
&&
*
p
!=
SRS_CONSTS_HTTP
_PATH_SEP
;
p
++
)
{
}
// whether the handler can handler the node.
...
...
@@ -541,7 +541,7 @@ SrsHttpMessage::SrsHttpMessage()
_uri
=
new
SrsHttpUri
();
_match
=
NULL
;
_requires_crossdomain
=
false
;
_http_ts_send_buffer
=
new
char
[
SRS_CONST
S_HTTP_TS_SEND_BUFFER_SIZE
];
_http_ts_send_buffer
=
new
char
[
__SR
S_HTTP_TS_SEND_BUFFER_SIZE
];
}
SrsHttpMessage
::~
SrsHttpMessage
()
...
...
trunk/src/app/srs_app_http.hpp
查看文件 @
1afa6ed
...
...
@@ -63,12 +63,7 @@ class SrsHttpHandler;
#define __SRS_CRLFCRLF "\r\n\r\n" // 0x0D0A0D0A
// @see SrsHttpMessage._http_ts_send_buffer
#define SRS_CONSTS_HTTP_TS_SEND_BUFFER_SIZE 4096
// linux path seprator
#define __PATH_SEP '/'
// query string seprator
#define __QUERY_SEP '?'
#define __SRS_HTTP_TS_SEND_BUFFER_SIZE 4096
// compare the path.
// full compare, extractly match.
...
...
trunk/src/app/srs_app_http_conn.cpp
查看文件 @
1afa6ed
...
...
@@ -272,7 +272,7 @@ int SrsHttpVhost::response_flv_file(SrsSocket* skt, SrsHttpMessage* req, string
while
(
left
>
0
)
{
ssize_t
nread
=
-
1
;
if
((
ret
=
fs
.
read
(
buf
,
SRS_CONST
S_HTTP_TS_SEND_BUFFER_SIZE
,
&
nread
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
fs
.
read
(
buf
,
__SR
S_HTTP_TS_SEND_BUFFER_SIZE
,
&
nread
))
!=
ERROR_SUCCESS
)
{
srs_warn
(
"read file %s failed, ret=%d"
,
fullpath
.
c_str
(),
ret
);
break
;
}
...
...
@@ -377,7 +377,7 @@ int SrsHttpVhost::response_flv_file2(SrsSocket* skt, SrsHttpMessage* req, string
// send data
while
(
left
>
0
)
{
ssize_t
nread
=
-
1
;
if
((
ret
=
fs
.
read
(
buf
,
SRS_CONST
S_HTTP_TS_SEND_BUFFER_SIZE
,
&
nread
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
fs
.
read
(
buf
,
__SR
S_HTTP_TS_SEND_BUFFER_SIZE
,
&
nread
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
...
...
@@ -427,7 +427,7 @@ int SrsHttpVhost::response_ts_file(SrsSocket* skt, SrsHttpMessage* req, string f
while
(
left
>
0
)
{
ssize_t
nread
=
-
1
;
if
((
ret
=
fs
.
read
(
buf
,
SRS_CONST
S_HTTP_TS_SEND_BUFFER_SIZE
,
&
nread
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
fs
.
read
(
buf
,
__SR
S_HTTP_TS_SEND_BUFFER_SIZE
,
&
nread
))
!=
ERROR_SUCCESS
)
{
srs_warn
(
"read file %s failed, ret=%d"
,
fullpath
.
c_str
(),
ret
);
break
;
}
...
...
trunk/src/app/srs_app_json.cpp
查看文件 @
1afa6ed
...
...
@@ -28,7 +28,7 @@ using namespace std;
#include <srs_kernel_log.hpp>
#include <srs_kernel_error.hpp>
#ifdef SRS_JSON_USE_NXJSON
#ifdef
__
SRS_JSON_USE_NXJSON
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
...
...
@@ -303,7 +303,7 @@ SrsJsonArray* SrsJsonAny::array()
return
new
SrsJsonArray
();
}
#ifdef SRS_JSON_USE_NXJSON
#ifdef
__
SRS_JSON_USE_NXJSON
SrsJsonAny
*
srs_json_parse_tree_nx_json
(
const
nx_json
*
node
)
{
if
(
!
node
)
{
...
...
@@ -490,7 +490,7 @@ void SrsJsonArray::add(SrsJsonAny* value)
properties
.
push_back
(
value
);
}
#ifdef SRS_JSON_USE_NXJSON
#ifdef
__
SRS_JSON_USE_NXJSON
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
...
...
trunk/src/app/srs_app_json.hpp
查看文件 @
1afa6ed
...
...
@@ -34,8 +34,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// whether use nxjson
// @see: https://bitbucket.org/yarosla/nxjson
#undef SRS_JSON_USE_NXJSON
#define SRS_JSON_USE_NXJSON
#undef __SRS_JSON_USE_NXJSON
#define __SRS_JSON_USE_NXJSON
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
trunk/src/kernel/srs_kernel_consts.hpp
查看文件 @
1afa6ed
...
...
@@ -160,6 +160,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
///////////////////////////////////////////////////////////
// HTTP consts values
///////////////////////////////////////////////////////////
// linux path seprator
#define SRS_CONSTS_HTTP_PATH_SEP '/'
// query string seprator
#define SRS_CONSTS_HTTP_QUERY_SEP '?'
// 6.1.1 Status Code and Reason Phrase
#define SRS_CONSTS_HTTP_Continue 100
#define SRS_CONSTS_HTTP_SwitchingProtocols 101
...
...
请
注册
或
登录
后发表评论