diff --git a/trunk/src/app/srs_app_http_conn.cpp b/trunk/src/app/srs_app_http_conn.cpp index 1023ed0c1..5476ae41a 100644 --- a/trunk/src/app/srs_app_http_conn.cpp +++ b/trunk/src/app/srs_app_http_conn.cpp @@ -1109,19 +1109,19 @@ int SrsHttpUri::initialize(string _url) return ret; } -const char* SrsHttpUri::get_url() +string SrsHttpUri::get_url() { - return url.data(); + return url; } -const char* SrsHttpUri::get_schema() +string SrsHttpUri::get_schema() { - return schema.data(); + return schema; } -const char* SrsHttpUri::get_host() +string SrsHttpUri::get_host() { - return host.data(); + return host; } int SrsHttpUri::get_port() @@ -1129,14 +1129,14 @@ int SrsHttpUri::get_port() return port; } -const char* SrsHttpUri::get_path() +string SrsHttpUri::get_path() { - return path.data(); + return path; } -const char* SrsHttpUri::get_query() +string SrsHttpUri::get_query() { - return query.data(); + return query; } string SrsHttpUri::get_uri_field(string uri, http_parser_url* hp_u, http_parser_url_fields field) diff --git a/trunk/src/app/srs_app_http_conn.hpp b/trunk/src/app/srs_app_http_conn.hpp index 64f826bc5..e54c3a1f5 100644 --- a/trunk/src/app/srs_app_http_conn.hpp +++ b/trunk/src/app/srs_app_http_conn.hpp @@ -369,12 +369,12 @@ public: */ virtual int initialize(std::string _url); public: - virtual const char* get_url(); - virtual const char* get_schema(); - virtual const char* get_host(); + virtual std::string get_url(); + virtual std::string get_schema(); + virtual std::string get_host(); virtual int get_port(); - virtual const char* get_path(); - virtual const char* get_query(); + virtual std::string get_path(); + virtual std::string get_query(); private: /** * get the parsed url field. diff --git a/trunk/src/main/srs_main_ingest_hls.cpp b/trunk/src/main/srs_main_ingest_hls.cpp index 8d84e0faa..fdf2a911a 100644 --- a/trunk/src/main/srs_main_ingest_hls.cpp +++ b/trunk/src/main/srs_main_ingest_hls.cpp @@ -378,7 +378,7 @@ int SrsIngestSrsInput::parseM3u8(SrsHttpUri* url, double& td, double& duration) int ret = ERROR_SUCCESS; SrsHttpClient client; - srs_trace("parse input hls %s", url->get_url()); + srs_trace("parse input hls %s", url->get_url().c_str()); if ((ret = client.initialize(url->get_host(), url->get_port())) != ERROR_SUCCESS) { srs_error("connect to server failed. ret=%d", ret); @@ -387,7 +387,7 @@ int SrsIngestSrsInput::parseM3u8(SrsHttpUri* url, double& td, double& duration) ISrsHttpMessage* msg = NULL; if ((ret = client.get(url->get_path(), "", &msg)) != ERROR_SUCCESS) { - srs_error("HTTP GET %s failed. ret=%d", url->get_url(), ret); + srs_error("HTTP GET %s failed. ret=%d", url->get_url().c_str(), ret); return ret; } @@ -609,7 +609,7 @@ int SrsIngestSrsInput::SrsTsPiece::fetch(string m3u8) ISrsHttpMessage* msg = NULL; if ((ret = client.get(uri.get_path(), "", &msg)) != ERROR_SUCCESS) { - srs_error("HTTP GET %s failed. ret=%d", uri.get_url(), ret); + srs_error("HTTP GET %s failed. ret=%d", uri.get_url().c_str(), ret); return ret; } @@ -1215,7 +1215,7 @@ int SrsIngestSrsOutput::connect() return ret; } - srs_trace("connect output=%s", out_rtmp->get_url()); + srs_trace("connect output=%s", out_rtmp->get_url().c_str()); // parse uri if (!req) { @@ -1322,7 +1322,7 @@ int SrsIngestSrsOutput::connect_app(string ep_server, int ep_port) void SrsIngestSrsOutput::close() { - srs_trace("close output=%s", out_rtmp->get_url()); + srs_trace("close output=%s", out_rtmp->get_url().c_str()); h264_sps_pps_sent = false; srs_freep(client);