1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix #158: http-callback check http status code ok(200). 2.0.84

This commit is contained in:
winlin 2015-01-02 10:21:04 +08:00
parent 8df0f724d6
commit 9d34820c80
10 changed files with 88 additions and 14 deletions

View file

@ -75,9 +75,10 @@ void SrsHttpHeartbeat::heartbeat()
ss << __SRS_JOBJECT_END;
std::string data = ss.str();
std::string res;
int status_code;
SrsHttpClient http;
if ((ret = http.post(&uri, data, res)) != ERROR_SUCCESS) {
if ((ret = http.post(&uri, data, status_code, res)) != ERROR_SUCCESS) {
srs_info("http post hartbeart uri failed. "
"url=%s, request=%s, response=%s, ret=%d",
url.c_str(), data.c_str(), res.c_str(), ret);
@ -85,8 +86,8 @@ void SrsHttpHeartbeat::heartbeat()
}
srs_info("http hook hartbeart success. "
"url=%s, request=%s, response=%s, ret=%d",
url.c_str(), data.c_str(), res.c_str(), ret);
"url=%s, request=%s, status_code=%d, response=%s, ret=%d",
url.c_str(), data.c_str(), status_code, res.c_str(), ret);
return;
}