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-10-04 08:10:57 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
ed80d9d281a34691dab1d264b258fecac3bc8cc5
ed80d9d2
2 parents
6587c5b2
0c8209cc
merge from srs2
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
20 行增加
和
7 行删除
README.md
trunk/src/app/srs_app_http_hooks.cpp
README.md
查看文件 @
ed80d9d
...
...
@@ -1102,6 +1102,7 @@ Winlin
[
bug #485
]:
https://github.com/simple-rtmp-server/srs/issues/485
[
bug #495
]:
https://github.com/simple-rtmp-server/srs/issues/495
[
bug #497
]:
https://github.com/simple-rtmp-server/srs/issues/497
[
bug #448
]:
https://github.com/simple-rtmp-server/srs/issues/448
[
bug #475
]:
https://github.com/simple-rtmp-server/srs/issues/475
[
bug #458
]:
https://github.com/simple-rtmp-server/srs/issues/458
[
bug #454
]:
https://github.com/simple-rtmp-server/srs/issues/454
...
...
trunk/src/app/srs_app_http_hooks.cpp
查看文件 @
ed80d9d
...
...
@@ -447,37 +447,49 @@ int SrsHttpHooks::do_post(SrsHttpClient* hc, std::string url, std::string req, i
// ensure the http status is ok.
// https://github.com/simple-rtmp-server/srs/issues/158
if
(
code
!=
SRS_CONSTS_HTTP_OK
)
{
return
ERROR_HTTP_STATUS_INVLIAD
;
ret
=
ERROR_HTTP_STATUS_INVLIAD
;
srs_error
(
"invalid response status=%d. ret=%d"
,
code
,
ret
);
return
ret
;
}
// should never be empty.
if
(
res
.
empty
())
{
return
ERROR_HTTP_DATA_INVLIAD
;
ret
=
ERROR_HTTP_DATA_INVLIAD
;
srs_error
(
"invalid empty response. ret=%d"
,
ret
);
return
ret
;
}
// parse string res to json.
SrsJsonAny
*
info
=
SrsJsonAny
::
loads
((
char
*
)
res
.
c_str
());
if
(
!
info
)
{
ret
=
ERROR_HTTP_DATA_INVLIAD
;
srs_error
(
"invalid response %s. ret=%d"
,
res
.
c_str
(),
ret
);
return
ret
;
}
SrsAutoFree
(
SrsJsonAny
,
info
);
//
if res is number of error code
//
response error code in string.
if
(
!
info
->
is_object
())
{
if
(
res
!=
SRS_HTTP_RESPONSE_OK
)
{
return
ERROR_HTTP_DATA_INVLIAD
;
ret
=
ERROR_HTTP_DATA_INVLIAD
;
srs_error
(
"invalid response number %s. ret=%d"
,
res
.
c_str
(),
ret
);
return
ret
;
}
return
ret
;
}
//
if res is json obj, like
: {"code": 0, "data": ""}
//
response standard object, format in json
: {"code": 0, "data": ""}
SrsJsonObject
*
res_info
=
info
->
to_object
();
SrsJsonAny
*
res_code
=
NULL
;
if
((
res_code
=
res_info
->
ensure_property_integer
(
"code"
))
==
NULL
)
{
ret
=
ERROR_RESPONSE_CODE
;
srs_error
(
"
res code error
, ret=%d"
,
ret
);
srs_error
(
"
invalid response without code
, ret=%d"
,
ret
);
return
ret
;
}
if
((
res_code
->
to_integer
())
!=
ERROR_SUCCESS
)
{
ret
=
ERROR_RESPONSE_CODE
;
srs_error
(
"
res code error, ret=%d, code=%d"
,
ret
,
code
);
srs_error
(
"
error response code=%d. ret=%d"
,
res_code
->
to_integer
(),
ret
);
return
ret
;
}
...
...
请
注册
或
登录
后发表评论