From bfff8413b628b2fde16849137d7ffbf3a8252709 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 18 Jan 2015 09:16:14 +0800 Subject: [PATCH] refine code for #277, the copy first param is the dest. --- trunk/src/app/srs_app_http.cpp | 4 ++-- trunk/src/app/srs_app_http.hpp | 2 +- trunk/src/app/srs_app_http_conn.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/trunk/src/app/srs_app_http.cpp b/trunk/src/app/srs_app_http.cpp index cdaaca3f3..696198b97 100644 --- a/trunk/src/app/srs_app_http.cpp +++ b/trunk/src/app/srs_app_http.cpp @@ -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; diff --git a/trunk/src/app/srs_app_http.hpp b/trunk/src/app/srs_app_http.hpp index 3c4005023..952097f20 100644 --- a/trunk/src/app/srs_app_http.hpp +++ b/trunk/src/app/srs_app_http.hpp @@ -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. diff --git a/trunk/src/app/srs_app_http_conn.cpp b/trunk/src/app/srs_app_http_conn.cpp index 8c6db2a3e..c60e6badb 100644 --- a/trunk/src/app/srs_app_http_conn.cpp +++ b/trunk/src/app/srs_app_http_conn.cpp @@ -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; }