From a3df4e3bfb2111adf2908876451757f3d81fbc9a Mon Sep 17 00:00:00 2001 From: Chengdong Zhang Date: Sat, 25 Feb 2017 11:28:59 +0800 Subject: [PATCH] Fix #744 http callback set a wrong default port (#777) * Add port verify Code is more robust * Verify port Verify port * Change hard code to defined. Change hard code to defined. --- trunk/src/protocol/srs_http_stack.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trunk/src/protocol/srs_http_stack.cpp b/trunk/src/protocol/srs_http_stack.cpp index fa6f28e3f..ed50ddfb8 100644 --- a/trunk/src/protocol/srs_http_stack.cpp +++ b/trunk/src/protocol/srs_http_stack.cpp @@ -3037,7 +3037,7 @@ int SrsHttpUri::initialize(string _url) { int ret = ERROR_SUCCESS; - port = 0; + //port = 0; schema = host = path = query = ""; url = _url; @@ -3063,6 +3063,9 @@ int SrsHttpUri::initialize(string _url) if(!field.empty()){ port = atoi(field.c_str()); } + if(port<=0){ + port = SRS_DEFAULT_HTTP_PORT; + } path = get_uri_field(url, &hp_u, UF_PATH); srs_info("parse url %s success", purl);