正在显示
4 个修改的文件
包含
15 行增加
和
15 行删除
| @@ -1312,7 +1312,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m | @@ -1312,7 +1312,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m | ||
| 1312 | : SrsConnection(cm, fd, cip) | 1312 | : SrsConnection(cm, fd, cip) |
| 1313 | { | 1313 | { |
| 1314 | mux = m; | 1314 | mux = m; |
| 1315 | - cros = new SrsHttpCrosMux(); | 1315 | + cors = new SrsHttpCorsMux(); |
| 1316 | parser = new SrsHttpParser(); | 1316 | parser = new SrsHttpParser(); |
| 1317 | 1317 | ||
| 1318 | _srs_config->subscribe(this); | 1318 | _srs_config->subscribe(this); |
| @@ -1321,7 +1321,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m | @@ -1321,7 +1321,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m | ||
| 1321 | SrsHttpApi::~SrsHttpApi() | 1321 | SrsHttpApi::~SrsHttpApi() |
| 1322 | { | 1322 | { |
| 1323 | srs_freep(parser); | 1323 | srs_freep(parser); |
| 1324 | - srs_freep(cros); | 1324 | + srs_freep(cors); |
| 1325 | 1325 | ||
| 1326 | _srs_config->unsubscribe(this); | 1326 | _srs_config->unsubscribe(this); |
| 1327 | } | 1327 | } |
| @@ -1367,9 +1367,9 @@ int SrsHttpApi::do_cycle() | @@ -1367,9 +1367,9 @@ int SrsHttpApi::do_cycle() | ||
| 1367 | // @see https://github.com/ossrs/srs/issues/398 | 1367 | // @see https://github.com/ossrs/srs/issues/398 |
| 1368 | skt.set_recv_timeout(SRS_HTTP_RECV_TIMEOUT_US); | 1368 | skt.set_recv_timeout(SRS_HTTP_RECV_TIMEOUT_US); |
| 1369 | 1369 | ||
| 1370 | - // initialize the cros, which will proxy to mux. | 1370 | + // initialize the cors, which will proxy to mux. |
| 1371 | bool crossdomain_enabled = _srs_config->get_http_api_crossdomain(); | 1371 | bool crossdomain_enabled = _srs_config->get_http_api_crossdomain(); |
| 1372 | - if ((ret = cros->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) { | 1372 | + if ((ret = cors->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) { |
| 1373 | return ret; | 1373 | return ret; |
| 1374 | } | 1374 | } |
| 1375 | 1375 | ||
| @@ -1425,7 +1425,7 @@ int SrsHttpApi::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) | @@ -1425,7 +1425,7 @@ int SrsHttpApi::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) | ||
| 1425 | hm->is_chunked(), hm->is_infinite_chunked()); | 1425 | hm->is_chunked(), hm->is_infinite_chunked()); |
| 1426 | 1426 | ||
| 1427 | // use default server mux to serve http request. | 1427 | // use default server mux to serve http request. |
| 1428 | - if ((ret = cros->serve_http(w, r)) != ERROR_SUCCESS) { | 1428 | + if ((ret = cors->serve_http(w, r)) != ERROR_SUCCESS) { |
| 1429 | if (!srs_is_client_gracefully_close(ret)) { | 1429 | if (!srs_is_client_gracefully_close(ret)) { |
| 1430 | srs_error("serve http msg failed. ret=%d", ret); | 1430 | srs_error("serve http msg failed. ret=%d", ret); |
| 1431 | } | 1431 | } |
| @@ -1440,7 +1440,7 @@ int SrsHttpApi::on_reload_http_api_crossdomain() | @@ -1440,7 +1440,7 @@ int SrsHttpApi::on_reload_http_api_crossdomain() | ||
| 1440 | int ret = ERROR_SUCCESS; | 1440 | int ret = ERROR_SUCCESS; |
| 1441 | 1441 | ||
| 1442 | bool crossdomain_enabled = _srs_config->get_http_api_crossdomain(); | 1442 | bool crossdomain_enabled = _srs_config->get_http_api_crossdomain(); |
| 1443 | - if ((ret = cros->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) { | 1443 | + if ((ret = cors->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) { |
| 1444 | return ret; | 1444 | return ret; |
| 1445 | } | 1445 | } |
| 1446 | 1446 |
| @@ -211,7 +211,7 @@ class SrsHttpApi : virtual public SrsConnection, virtual public ISrsReloadHandle | @@ -211,7 +211,7 @@ class SrsHttpApi : virtual public SrsConnection, virtual public ISrsReloadHandle | ||
| 211 | { | 211 | { |
| 212 | private: | 212 | private: |
| 213 | SrsHttpParser* parser; | 213 | SrsHttpParser* parser; |
| 214 | - SrsHttpCrosMux* cros; | 214 | + SrsHttpCorsMux* cors; |
| 215 | SrsHttpServeMux* mux; | 215 | SrsHttpServeMux* mux; |
| 216 | public: | 216 | public: |
| 217 | SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, std::string cip); | 217 | SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, std::string cip); |
| @@ -761,18 +761,18 @@ bool SrsHttpServeMux::path_match(string pattern, string path) | @@ -761,18 +761,18 @@ bool SrsHttpServeMux::path_match(string pattern, string path) | ||
| 761 | return false; | 761 | return false; |
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | -SrsHttpCrosMux::SrsHttpCrosMux() | 764 | +SrsHttpCorsMux::SrsHttpCorsMux() |
| 765 | { | 765 | { |
| 766 | next = NULL; | 766 | next = NULL; |
| 767 | enabled = false; | 767 | enabled = false; |
| 768 | required = false; | 768 | required = false; |
| 769 | } | 769 | } |
| 770 | 770 | ||
| 771 | -SrsHttpCrosMux::~SrsHttpCrosMux() | 771 | +SrsHttpCorsMux::~SrsHttpCorsMux() |
| 772 | { | 772 | { |
| 773 | } | 773 | } |
| 774 | 774 | ||
| 775 | -int SrsHttpCrosMux::initialize(ISrsHttpServeMux* worker, bool cros_enabled) | 775 | +int SrsHttpCorsMux::initialize(ISrsHttpServeMux* worker, bool cros_enabled) |
| 776 | { | 776 | { |
| 777 | next = worker; | 777 | next = worker; |
| 778 | enabled = cros_enabled; | 778 | enabled = cros_enabled; |
| @@ -780,7 +780,7 @@ int SrsHttpCrosMux::initialize(ISrsHttpServeMux* worker, bool cros_enabled) | @@ -780,7 +780,7 @@ int SrsHttpCrosMux::initialize(ISrsHttpServeMux* worker, bool cros_enabled) | ||
| 780 | return ERROR_SUCCESS; | 780 | return ERROR_SUCCESS; |
| 781 | } | 781 | } |
| 782 | 782 | ||
| 783 | -int SrsHttpCrosMux::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) | 783 | +int SrsHttpCorsMux::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r) |
| 784 | { | 784 | { |
| 785 | // method is OPTIONS and enable crossdomain, required crossdomain header. | 785 | // method is OPTIONS and enable crossdomain, required crossdomain header. |
| 786 | if (r->is_http_options() && enabled) { | 786 | if (r->is_http_options() && enabled) { |
| @@ -443,18 +443,18 @@ private: | @@ -443,18 +443,18 @@ private: | ||
| 443 | }; | 443 | }; |
| 444 | 444 | ||
| 445 | /** | 445 | /** |
| 446 | - * The filter http mux, directly serve the http CROS requests, | 446 | + * The filter http mux, directly serve the http CORS requests, |
| 447 | * while proxy to the worker mux for services. | 447 | * while proxy to the worker mux for services. |
| 448 | */ | 448 | */ |
| 449 | -class SrsHttpCrosMux : public ISrsHttpServeMux | 449 | +class SrsHttpCorsMux : public ISrsHttpServeMux |
| 450 | { | 450 | { |
| 451 | private: | 451 | private: |
| 452 | bool required; | 452 | bool required; |
| 453 | bool enabled; | 453 | bool enabled; |
| 454 | ISrsHttpServeMux* next; | 454 | ISrsHttpServeMux* next; |
| 455 | public: | 455 | public: |
| 456 | - SrsHttpCrosMux(); | ||
| 457 | - virtual ~SrsHttpCrosMux(); | 456 | + SrsHttpCorsMux(); |
| 457 | + virtual ~SrsHttpCorsMux(); | ||
| 458 | public: | 458 | public: |
| 459 | virtual int initialize(ISrsHttpServeMux* worker, bool cros_enabled); | 459 | virtual int initialize(ISrsHttpServeMux* worker, bool cros_enabled); |
| 460 | // interface ISrsHttpServeMux | 460 | // interface ISrsHttpServeMux |
-
请 注册 或 登录 后发表评论