Skip to content

Commit

Permalink
Fix #904, replace NXJSON(LGPL) with json-parser(BSD). 3.0.23
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed May 29, 2017
1 parent 6993ac2 commit 54411e0
Show file tree
Hide file tree
Showing 6 changed files with 1,427 additions and 572 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Please select your language:

### V3 changes

* v3.0, 2017-05-30, Fix [#904][bug #904], replace NXJSON(LGPL) with json-parser(BSD). 3.0.23
* v3.0, 2017-04-16, Fix [#547][bug #547], support HLS audio in TS. 3.0.22
* v3.0, 2017-03-26, Fix [#820][bug #820], extract service for modules. 3.0.21
* v3.0, 2017-03-02, Fix [#786][bug #786], simply don't reuse object. 3.0.20
Expand Down Expand Up @@ -1417,6 +1418,7 @@ Winlin
[bug #786]: https://github.com/ossrs/srs/issues/786
[bug #820]: https://github.com/ossrs/srs/issues/820
[bug #547]: https://github.com/ossrs/srs/issues/547
[bug #904]: https://github.com/ossrs/srs/issues/904
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
24 changes: 12 additions & 12 deletions trunk/research/api-server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def POST(self):
except Exception, ex:
code = Error.system_parse_json
trace("parse the request to json failed, req=%s, ex=%s, code=%s"%(req, ex, code))
return str(code)
return json.dumps({"code": int(code), "data": None})

action = json_req["action"]
if action == "on_connect":
Expand All @@ -128,7 +128,7 @@ def POST(self):
trace("invalid request action: %s"%(json_req["action"]))
code = Error.request_invalid_action

return str(code)
return json.dumps({"code": int(code), "data": None})

def OPTIONS(self, *args, **kwargs):
enable_crossdomain()
Expand Down Expand Up @@ -204,7 +204,7 @@ def POST(self):
except Exception, ex:
code = Error.system_parse_json
trace("parse the request to json failed, req=%s, ex=%s, code=%s"%(req, ex, code))
return str(code)
return json.dumps({"code": int(code), "data": None})

action = json_req["action"]
if action == "on_publish":
Expand All @@ -215,7 +215,7 @@ def POST(self):
trace("invalid request action: %s"%(json_req["action"]))
code = Error.request_invalid_action

return str(code)
return json.dumps({"code": int(code), "data": None})

def OPTIONS(self, *args, **kwargs):
enable_crossdomain()
Expand Down Expand Up @@ -284,7 +284,7 @@ def POST(self):
except Exception, ex:
code = Error.system_parse_json
trace("parse the request to json failed, req=%s, ex=%s, code=%s"%(req, ex, code))
return str(code)
return json.dumps({"code": int(code), "data": None})

action = json_req["action"]
if action == "on_dvr":
Expand All @@ -293,7 +293,7 @@ def POST(self):
trace("invalid request action: %s"%(json_req["action"]))
code = Error.request_invalid_action

return str(code)
return json.dumps({"code": int(code), "data": None})

def OPTIONS(self, *args, **kwargs):
enable_crossdomain()
Expand Down Expand Up @@ -405,7 +405,7 @@ def POST(self):
except Exception, ex:
code = Error.system_parse_json
trace("parse the request to json failed, req=%s, ex=%s, code=%s"%(req, ex, code))
return str(code)
return json.dumps({"code": int(code), "data": None})

action = json_req["action"]
if action == "on_hls":
Expand All @@ -414,7 +414,7 @@ def POST(self):
trace("invalid request action: %s"%(json_req["action"]))
code = Error.request_invalid_action

return str(code)
return json.dumps({"code": int(code), "data": None})

def OPTIONS(self, *args, **kwargs):
enable_crossdomain()
Expand Down Expand Up @@ -481,7 +481,7 @@ def POST(self):
except Exception, ex:
code = Error.system_parse_json
trace("parse the request to json failed, req=%s, ex=%s, code=%s"%(req, ex, code))
return str(code)
return json.dumps({"code": int(code), "data": None})

action = json_req["action"]
if action == "on_play":
Expand All @@ -492,7 +492,7 @@ def POST(self):
trace("invalid request action: %s"%(json_req["action"]))
code = Error.request_invalid_action

return str(code)
return json.dumps({"code": int(code), "data": None})

def OPTIONS(self, *args, **kwargs):
enable_crossdomain()
Expand Down Expand Up @@ -803,7 +803,7 @@ def POST(self):
except Exception, ex:
code = Error.system_parse_json
trace("parse the request to json failed, req=%s, ex=%s, code=%s"%(req, ex, code))
return str(code)
return json.dumps({"code": int(code), "data": None})

action = json_req["action"]
if action == "on_publish":
Expand All @@ -814,7 +814,7 @@ def POST(self):
trace("invalid request action: %s"%(json_req["action"]))
code = Error.request_invalid_action

return str(code)
return json.dumps({"code": int(code), "data": None})

def OPTIONS(self, *args, **kwargs):
enable_crossdomain()
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_http_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ int SrsHttpHooks::do_post(SrsHttpClient* hc, std::string url, std::string req, i
}

// parse string res to json.
SrsJsonAny* info = SrsJsonAny::loads((char*)res.c_str());
SrsJsonAny* info = SrsJsonAny::loads(res);
if (!info) {
ret = ERROR_HTTP_DATA_INVALID;
srs_error("invalid response %s. ret=%d", res.c_str(), ret);
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// current release version
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION 22
#define VERSION_REVISION 23

// generated by configure, only macros.
#include <srs_auto_headers.hpp>
Expand Down
Loading

0 comments on commit 54411e0

Please sign in to comment.