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

for #179, enable http api crossdomain for dvr api.

This commit is contained in:
winlin 2015-02-21 21:17:59 +08:00
parent 1445086451
commit c67a4fdf97
11 changed files with 267 additions and 3 deletions

View file

@ -139,6 +139,9 @@ bool srs_go_http_body_allowd(int status)
// returns "application/octet-stream".
string srs_go_http_detect(char* data, int size)
{
// detect only when data specified.
if (data) {
}
return "application/octet-stream"; // fallback
}
@ -715,8 +718,8 @@ int SrsGoHttpResponseWriter::final_request()
return skt->write((void*)ch.data(), (int)ch.length(), NULL);
}
// ignore when send with content length
return ERROR_SUCCESS;
// flush when send with content length
return write(NULL, 0);
}
SrsGoHttpHeader* SrsGoHttpResponseWriter::header()
@ -743,6 +746,11 @@ int SrsGoHttpResponseWriter::write(char* data, int size)
srs_error("http: send header failed. ret=%d", ret);
return ret;
}
// ignore NULL content.
if (!data) {
return ret;
}
// directly send with content length
if (content_length != -1) {