refine code for #277, the copy first param is the dest.
This commit is contained in:
parent
c695a8fcbd
commit
bfff8413b6
|
|
@ -344,7 +344,7 @@ int SrsGoHttpFileServer::serve_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage*
|
|||
|
||||
// write body.
|
||||
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);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -357,7 +357,7 @@ int SrsGoHttpFileServer::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMe
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ protected:
|
|||
/**
|
||||
* 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.
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ int SrsVodStream::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage*
|
|||
}
|
||||
|
||||
// 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);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user