Skip to content

Commit

Permalink
fix typo for #513, #691
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 15, 2016
1 parent 664844b commit f666198
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions trunk/src/app/srs_app_http_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m
: SrsConnection(cm, fd, cip)
{
mux = m;
cros = new SrsHttpCrosMux();
cors = new SrsHttpCorsMux();
parser = new SrsHttpParser();

_srs_config->subscribe(this);
Expand All @@ -1321,7 +1321,7 @@ SrsHttpApi::SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m
SrsHttpApi::~SrsHttpApi()
{
srs_freep(parser);
srs_freep(cros);
srs_freep(cors);

_srs_config->unsubscribe(this);
}
Expand Down Expand Up @@ -1367,9 +1367,9 @@ int SrsHttpApi::do_cycle()
// @see https://github.com/ossrs/srs/issues/398
skt.set_recv_timeout(SRS_HTTP_RECV_TIMEOUT_US);

// initialize the cros, which will proxy to mux.
// initialize the cors, which will proxy to mux.
bool crossdomain_enabled = _srs_config->get_http_api_crossdomain();
if ((ret = cros->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) {
if ((ret = cors->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) {
return ret;
}

Expand Down Expand Up @@ -1425,7 +1425,7 @@ int SrsHttpApi::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
hm->is_chunked(), hm->is_infinite_chunked());

// use default server mux to serve http request.
if ((ret = cros->serve_http(w, r)) != ERROR_SUCCESS) {
if ((ret = cors->serve_http(w, r)) != ERROR_SUCCESS) {
if (!srs_is_client_gracefully_close(ret)) {
srs_error("serve http msg failed. ret=%d", ret);
}
Expand All @@ -1440,7 +1440,7 @@ int SrsHttpApi::on_reload_http_api_crossdomain()
int ret = ERROR_SUCCESS;

bool crossdomain_enabled = _srs_config->get_http_api_crossdomain();
if ((ret = cros->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) {
if ((ret = cors->initialize(mux, crossdomain_enabled)) != ERROR_SUCCESS) {
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_http_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class SrsHttpApi : virtual public SrsConnection, virtual public ISrsReloadHandle
{
private:
SrsHttpParser* parser;
SrsHttpCrosMux* cros;
SrsHttpCorsMux* cors;
SrsHttpServeMux* mux;
public:
SrsHttpApi(IConnectionManager* cm, st_netfd_t fd, SrsHttpServeMux* m, std::string cip);
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/protocol/srs_http_stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,26 +761,26 @@ bool SrsHttpServeMux::path_match(string pattern, string path)
return false;
}

SrsHttpCrosMux::SrsHttpCrosMux()
SrsHttpCorsMux::SrsHttpCorsMux()
{
next = NULL;
enabled = false;
required = false;
}

SrsHttpCrosMux::~SrsHttpCrosMux()
SrsHttpCorsMux::~SrsHttpCorsMux()
{
}

int SrsHttpCrosMux::initialize(ISrsHttpServeMux* worker, bool cros_enabled)
int SrsHttpCorsMux::initialize(ISrsHttpServeMux* worker, bool cros_enabled)
{
next = worker;
enabled = cros_enabled;

return ERROR_SUCCESS;
}

int SrsHttpCrosMux::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
int SrsHttpCorsMux::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{
// method is OPTIONS and enable crossdomain, required crossdomain header.
if (r->is_http_options() && enabled) {
Expand Down
8 changes: 4 additions & 4 deletions trunk/src/protocol/srs_http_stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,18 @@ class SrsHttpServeMux : public ISrsHttpServeMux
};

/**
* The filter http mux, directly serve the http CROS requests,
* The filter http mux, directly serve the http CORS requests,
* while proxy to the worker mux for services.
*/
class SrsHttpCrosMux : public ISrsHttpServeMux
class SrsHttpCorsMux : public ISrsHttpServeMux
{
private:
bool required;
bool enabled;
ISrsHttpServeMux* next;
public:
SrsHttpCrosMux();
virtual ~SrsHttpCrosMux();
SrsHttpCorsMux();
virtual ~SrsHttpCorsMux();
public:
virtual int initialize(ISrsHttpServeMux* worker, bool cros_enabled);
// interface ISrsHttpServeMux
Expand Down

0 comments on commit f666198

Please sign in to comment.