diff --git a/trunk/src/app/srs_app_http.cpp b/trunk/src/app/srs_app_http.cpp index 202aae90a..0488907d5 100644 --- a/trunk/src/app/srs_app_http.cpp +++ b/trunk/src/app/srs_app_http.cpp @@ -169,7 +169,7 @@ int SrsHttpHandler::best_match(const char* path, int length, SrsHttpHandlerMatch } const char* p = NULL; - for (p = path + 1; p - path < length && *p != __PATH_SEP; p++) { + for (p = path + 1; p - path < length && *p != SRS_CONSTS_HTTP_PATH_SEP; p++) { } // whether the handler can handler the node. @@ -541,7 +541,7 @@ SrsHttpMessage::SrsHttpMessage() _uri = new SrsHttpUri(); _match = NULL; _requires_crossdomain = false; - _http_ts_send_buffer = new char[SRS_CONSTS_HTTP_TS_SEND_BUFFER_SIZE]; + _http_ts_send_buffer = new char[__SRS_HTTP_TS_SEND_BUFFER_SIZE]; } SrsHttpMessage::~SrsHttpMessage() diff --git a/trunk/src/app/srs_app_http.hpp b/trunk/src/app/srs_app_http.hpp index aa800665f..365272b21 100644 --- a/trunk/src/app/srs_app_http.hpp +++ b/trunk/src/app/srs_app_http.hpp @@ -63,12 +63,7 @@ class SrsHttpHandler; #define __SRS_CRLFCRLF "\r\n\r\n" // 0x0D0A0D0A // @see SrsHttpMessage._http_ts_send_buffer -#define SRS_CONSTS_HTTP_TS_SEND_BUFFER_SIZE 4096 - -// linux path seprator -#define __PATH_SEP '/' -// query string seprator -#define __QUERY_SEP '?' +#define __SRS_HTTP_TS_SEND_BUFFER_SIZE 4096 // compare the path. // full compare, extractly match. diff --git a/trunk/src/app/srs_app_http_conn.cpp b/trunk/src/app/srs_app_http_conn.cpp index 56af15ecc..a91cd4e07 100644 --- a/trunk/src/app/srs_app_http_conn.cpp +++ b/trunk/src/app/srs_app_http_conn.cpp @@ -272,7 +272,7 @@ int SrsHttpVhost::response_flv_file(SrsSocket* skt, SrsHttpMessage* req, string while (left > 0) { ssize_t nread = -1; - if ((ret = fs.read(buf, SRS_CONSTS_HTTP_TS_SEND_BUFFER_SIZE, &nread)) != ERROR_SUCCESS) { + if ((ret = fs.read(buf, __SRS_HTTP_TS_SEND_BUFFER_SIZE, &nread)) != ERROR_SUCCESS) { srs_warn("read file %s failed, ret=%d", fullpath.c_str(), ret); break; } @@ -377,7 +377,7 @@ int SrsHttpVhost::response_flv_file2(SrsSocket* skt, SrsHttpMessage* req, string // send data while (left > 0) { ssize_t nread = -1; - if ((ret = fs.read(buf, SRS_CONSTS_HTTP_TS_SEND_BUFFER_SIZE, &nread)) != ERROR_SUCCESS) { + if ((ret = fs.read(buf, __SRS_HTTP_TS_SEND_BUFFER_SIZE, &nread)) != ERROR_SUCCESS) { return ret; } @@ -427,7 +427,7 @@ int SrsHttpVhost::response_ts_file(SrsSocket* skt, SrsHttpMessage* req, string f while (left > 0) { ssize_t nread = -1; - if ((ret = fs.read(buf, SRS_CONSTS_HTTP_TS_SEND_BUFFER_SIZE, &nread)) != ERROR_SUCCESS) { + if ((ret = fs.read(buf, __SRS_HTTP_TS_SEND_BUFFER_SIZE, &nread)) != ERROR_SUCCESS) { srs_warn("read file %s failed, ret=%d", fullpath.c_str(), ret); break; } diff --git a/trunk/src/app/srs_app_json.cpp b/trunk/src/app/srs_app_json.cpp index 8e8cfdfdf..653bc8c72 100644 --- a/trunk/src/app/srs_app_json.cpp +++ b/trunk/src/app/srs_app_json.cpp @@ -28,7 +28,7 @@ using namespace std; #include #include -#ifdef SRS_JSON_USE_NXJSON +#ifdef __SRS_JSON_USE_NXJSON //////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////// @@ -303,7 +303,7 @@ SrsJsonArray* SrsJsonAny::array() return new SrsJsonArray(); } -#ifdef SRS_JSON_USE_NXJSON +#ifdef __SRS_JSON_USE_NXJSON SrsJsonAny* srs_json_parse_tree_nx_json(const nx_json* node) { if (!node) { @@ -490,7 +490,7 @@ void SrsJsonArray::add(SrsJsonAny* value) properties.push_back(value); } -#ifdef SRS_JSON_USE_NXJSON +#ifdef __SRS_JSON_USE_NXJSON //////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/trunk/src/app/srs_app_json.hpp b/trunk/src/app/srs_app_json.hpp index bca97a5b7..dcda34975 100644 --- a/trunk/src/app/srs_app_json.hpp +++ b/trunk/src/app/srs_app_json.hpp @@ -34,8 +34,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // whether use nxjson // @see: https://bitbucket.org/yarosla/nxjson -#undef SRS_JSON_USE_NXJSON -#define SRS_JSON_USE_NXJSON +#undef __SRS_JSON_USE_NXJSON +#define __SRS_JSON_USE_NXJSON //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/trunk/src/kernel/srs_kernel_consts.hpp b/trunk/src/kernel/srs_kernel_consts.hpp index be4bba2af..25f74f82f 100644 --- a/trunk/src/kernel/srs_kernel_consts.hpp +++ b/trunk/src/kernel/srs_kernel_consts.hpp @@ -160,6 +160,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /////////////////////////////////////////////////////////// // HTTP consts values /////////////////////////////////////////////////////////// +// linux path seprator +#define SRS_CONSTS_HTTP_PATH_SEP '/' +// query string seprator +#define SRS_CONSTS_HTTP_QUERY_SEP '?' + // 6.1.1 Status Code and Reason Phrase #define SRS_CONSTS_HTTP_Continue 100 #define SRS_CONSTS_HTTP_SwitchingProtocols 101