winlin

refine the hls_on_notify, only read a chunk.

@@ -243,7 +243,7 @@ int SrsDvrAsyncCallOnHlsNotify::call() @@ -243,7 +243,7 @@ int SrsDvrAsyncCallOnHlsNotify::call()
243 for (int i = 0; i < (int)on_hls->args.size(); i++) { 243 for (int i = 0; i < (int)on_hls->args.size(); i++) {
244 std::string url = on_hls->args.at(i); 244 std::string url = on_hls->args.at(i);
245 if ((ret = SrsHttpHooks::on_hls_notify(url, req, ts_url)) != ERROR_SUCCESS) { 245 if ((ret = SrsHttpHooks::on_hls_notify(url, req, ts_url)) != ERROR_SUCCESS) {
246 - srs_error("hook client on_hls_notify failed. url=%s, ret=%d", url.c_str(), ret); 246 + srs_error("hook client on_hls_notify failed. url=%s, ts=%s, ret=%d", url.c_str(), ts_url.c_str(), ret);
247 return ret; 247 return ret;
248 } 248 }
249 } 249 }
@@ -361,9 +361,9 @@ int SrsHttpHooks::on_hls_notify(std::string url, SrsRequest* req, std::string ts @@ -361,9 +361,9 @@ int SrsHttpHooks::on_hls_notify(std::string url, SrsRequest* req, std::string ts
361 ISrsHttpResponseReader* br = msg->body_reader(); 361 ISrsHttpResponseReader* br = msg->body_reader();
362 while (!br->eof()) { 362 while (!br->eof()) {
363 std::string data; 363 std::string data;
364 - if ((ret = br->read(data)) != ERROR_SUCCESS) {  
365 - break;  
366 - } 364 + // for notify, only read some data.
  365 + ret = br->read(data);
  366 + break;
367 } 367 }
368 368
369 srs_trace("http hook on_hls_notify success. client_id=%d, url=%s, code=%d, ret=%d", 369 srs_trace("http hook on_hls_notify success. client_id=%d, url=%s, code=%d, ret=%d",