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

refine code for #277, the copy first param is the dest.

This commit is contained in:
winlin 2015-01-18 09:16:14 +08:00
parent c695a8fcbd
commit bfff8413b6
3 changed files with 4 additions and 4 deletions

View file

@ -344,7 +344,7 @@ int SrsGoHttpFileServer::serve_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage*
// write body. // write body.
int64_t left = length; int64_t left = length;
if ((ret = copy(&fs, w, r, left)) != ERROR_SUCCESS) { if ((ret = copy(w, &fs, r, left)) != ERROR_SUCCESS) {
srs_warn("read file=%s size=%d failed, ret=%d", fullpath.c_str(), left, ret); srs_warn("read file=%s size=%d failed, ret=%d", fullpath.c_str(), left, ret);
return ret; return ret;
} }
@ -357,7 +357,7 @@ int SrsGoHttpFileServer::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMe
return serve_file(w, r, fullpath); return serve_file(w, r, fullpath);
} }
int SrsGoHttpFileServer::copy(SrsFileReader* fs, ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, int size) int SrsGoHttpFileServer::copy(ISrsGoHttpResponseWriter* w, SrsFileReader* fs, SrsHttpMessage* r, int size)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;

View file

@ -217,7 +217,7 @@ protected:
/** /**
* copy the fs to response writer in size bytes. * copy the fs to response writer in size bytes.
*/ */
virtual int copy(SrsFileReader* fs, ISrsGoHttpResponseWriter* w, SrsHttpMessage* r, int size); virtual int copy(ISrsGoHttpResponseWriter* w, SrsFileReader* fs, SrsHttpMessage* r, int size);
}; };
// the mux entry for server mux. // the mux entry for server mux.

View file

@ -127,7 +127,7 @@ int SrsVodStream::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage*
} }
// send data // send data
if ((ret = copy(&fs, w, r, left)) != ERROR_SUCCESS) { if ((ret = copy(w, &fs, r, left)) != ERROR_SUCCESS) {
srs_warn("read flv=%s size=%d failed, ret=%d", fullpath.c_str(), left, ret); srs_warn("read flv=%s size=%d failed, ret=%d", fullpath.c_str(), left, ret);
return ret; return ret;
} }