Revert "Enhancement: Add option to disable Web-Management-Interface"
This reverts commit c48835e230.
This commit is contained in:
parent
51604400f3
commit
025dc300ce
@ -614,7 +614,6 @@ static char Usage[] = "Usage: turnserver [options]\n"
|
||||
" After the initialization, the turnserver process\n"
|
||||
" will make an attempt to change the current group ID to that group.\n"
|
||||
" --mobility Mobility with ICE (MICE) specs support.\n"
|
||||
" --no-http Turn OFF the HTTP-Admin-Interface. By default it is always ON.\n"
|
||||
" -K, --keep-address-family TURN server allocates address family according TURN\n"
|
||||
" Client <=> Server communication address family. \n"
|
||||
" !! It breaks RFC6156 section-4.2 (violates default IPv4) !!\n"
|
||||
@ -876,7 +875,6 @@ static const struct myoption long_options[] = {
|
||||
{ "cli-ip", required_argument, NULL, CLI_IP_OPT },
|
||||
{ "cli-port", required_argument, NULL, CLI_PORT_OPT },
|
||||
{ "cli-password", required_argument, NULL, CLI_PASSWORD_OPT },
|
||||
{ "no-http", optional_argument, NULL, NO_HTTP_OPT },
|
||||
{ "server-relay", optional_argument, NULL, SERVER_RELAY_OPT },
|
||||
{ "cli-max-output-sessions", required_argument, NULL, CLI_MAX_SESSIONS_OPT },
|
||||
{ "ec-curve-name", required_argument, NULL, EC_CURVE_NAME_OPT },
|
||||
@ -1165,9 +1163,6 @@ static void set_option(int c, char *value)
|
||||
case NO_CLI_OPT:
|
||||
use_cli = !get_bool_value(value);
|
||||
break;
|
||||
case NO_HTTP_OPT:
|
||||
use_http = !get_bool_value(value);
|
||||
break;
|
||||
case CLI_IP_OPT:
|
||||
if(make_ioa_addr((const u08bits*)value,0,&cli_addr)<0) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR,"Cannot set cli address: %s\n",value);
|
||||
|
||||
@ -1669,7 +1669,6 @@ static void setup_relay_server(struct relay_server *rs, ioa_engine_handle e, int
|
||||
allocate_bps,
|
||||
turn_params.oauth,
|
||||
turn_params.oauth_server_name,
|
||||
use_http,
|
||||
turn_params.keep_address_family);
|
||||
|
||||
if(to_set_rfc5780) {
|
||||
|
||||
@ -77,8 +77,6 @@ struct admin_server adminserver;
|
||||
|
||||
int use_cli = 1;
|
||||
|
||||
int use_http = 1;
|
||||
|
||||
ioa_addr cli_addr;
|
||||
int cli_addr_set = 0;
|
||||
|
||||
@ -1212,7 +1210,8 @@ void setup_admin_thread(void)
|
||||
bufferevent_setcb(adminserver.in_buf, admin_server_receive_message, NULL, NULL, &adminserver);
|
||||
bufferevent_enable(adminserver.in_buf, EV_READ);
|
||||
}
|
||||
if (use_http) {
|
||||
|
||||
{
|
||||
struct bufferevent *pair[2];
|
||||
|
||||
bufferevent_pair_new(adminserver.event_base, TURN_BUFFEREVENTS_OPTIONS, pair);
|
||||
|
||||
@ -81,8 +81,6 @@ extern struct admin_server adminserver;
|
||||
|
||||
extern int use_cli;
|
||||
|
||||
extern int use_http;
|
||||
|
||||
#define CLI_DEFAULT_IP ("127.0.0.1")
|
||||
extern ioa_addr cli_addr;
|
||||
extern int cli_addr_set;
|
||||
|
||||
@ -4574,34 +4574,32 @@ static int read_client_connection(turn_turnserver *server,
|
||||
}
|
||||
|
||||
} else {
|
||||
if (server->use_http) {
|
||||
SOCKET_TYPE st = get_ioa_socket_type(ss->client_socket);
|
||||
if(is_stream_socket(st)) {
|
||||
if(is_http((char*)ioa_network_buffer_data(in_buffer->nbh), ioa_network_buffer_get_size(in_buffer->nbh))) {
|
||||
const char *proto = "HTTP";
|
||||
ioa_network_buffer_data(in_buffer->nbh)[ioa_network_buffer_get_size(in_buffer->nbh)] = 0;
|
||||
if(st==TLS_SOCKET) {
|
||||
proto = "HTTPS";
|
||||
set_ioa_socket_app_type(ss->client_socket,HTTPS_CLIENT_SOCKET);
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s: %s (%s %s) request: %s\n", __FUNCTION__, proto, get_ioa_socket_cipher(ss->client_socket), get_ioa_socket_ssl_method(ss->client_socket), (char*)ioa_network_buffer_data(in_buffer->nbh));
|
||||
if(server->send_https_socket) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s socket to be detached: 0x%lx, st=%d, sat=%d\n", __FUNCTION__,(long)ss->client_socket, get_ioa_socket_type(ss->client_socket), get_ioa_socket_app_type(ss->client_socket));
|
||||
ioa_socket_handle new_s = detach_ioa_socket(ss->client_socket);
|
||||
if(new_s) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s new detached socket: 0x%lx, st=%d, sat=%d\n", __FUNCTION__,(long)new_s, get_ioa_socket_type(new_s), get_ioa_socket_app_type(new_s));
|
||||
server->send_https_socket(new_s);
|
||||
}
|
||||
ss->to_be_closed = 1;
|
||||
SOCKET_TYPE st = get_ioa_socket_type(ss->client_socket);
|
||||
if(is_stream_socket(st)) {
|
||||
if(is_http((char*)ioa_network_buffer_data(in_buffer->nbh), ioa_network_buffer_get_size(in_buffer->nbh))) {
|
||||
const char *proto = "HTTP";
|
||||
ioa_network_buffer_data(in_buffer->nbh)[ioa_network_buffer_get_size(in_buffer->nbh)] = 0;
|
||||
if(st==TLS_SOCKET) {
|
||||
proto = "HTTPS";
|
||||
set_ioa_socket_app_type(ss->client_socket,HTTPS_CLIENT_SOCKET);
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s: %s (%s %s) request: %s\n", __FUNCTION__, proto, get_ioa_socket_cipher(ss->client_socket), get_ioa_socket_ssl_method(ss->client_socket), (char*)ioa_network_buffer_data(in_buffer->nbh));
|
||||
if(server->send_https_socket) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s socket to be detached: 0x%lx, st=%d, sat=%d\n", __FUNCTION__,(long)ss->client_socket, get_ioa_socket_type(ss->client_socket), get_ioa_socket_app_type(ss->client_socket));
|
||||
ioa_socket_handle new_s = detach_ioa_socket(ss->client_socket);
|
||||
if(new_s) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s new detached socket: 0x%lx, st=%d, sat=%d\n", __FUNCTION__,(long)new_s, get_ioa_socket_type(new_s), get_ioa_socket_app_type(new_s));
|
||||
server->send_https_socket(new_s);
|
||||
}
|
||||
} else {
|
||||
set_ioa_socket_app_type(ss->client_socket,HTTP_CLIENT_SOCKET);
|
||||
if(server->verbose) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s: %s request: %s\n", __FUNCTION__, proto, (char*)ioa_network_buffer_data(in_buffer->nbh));
|
||||
}
|
||||
handle_http_echo(ss->client_socket);
|
||||
ss->to_be_closed = 1;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
set_ioa_socket_app_type(ss->client_socket,HTTP_CLIENT_SOCKET);
|
||||
if(server->verbose) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_INFO, "%s: %s request: %s\n", __FUNCTION__, proto, (char*)ioa_network_buffer_data(in_buffer->nbh));
|
||||
}
|
||||
handle_http_echo(ss->client_socket);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4860,7 +4858,6 @@ void init_turn_server(turn_turnserver* server,
|
||||
allocate_bps_cb allocate_bps_func,
|
||||
int oauth,
|
||||
const char* oauth_server_name,
|
||||
int use_http,
|
||||
int keep_address_family) {
|
||||
|
||||
if (!server)
|
||||
@ -4928,8 +4925,6 @@ void init_turn_server(turn_turnserver* server,
|
||||
|
||||
server->allocate_bps_func = allocate_bps_func;
|
||||
|
||||
server->use_http = use_http;
|
||||
|
||||
server->keep_address_family = keep_address_family;
|
||||
|
||||
set_ioa_timer(server->e, 1, 0, timer_timeout_handler, server, 1, "timer_timeout_handler");
|
||||
|
||||
@ -170,9 +170,6 @@ struct _turn_turnserver {
|
||||
int oauth;
|
||||
const char* oauth_server_name;
|
||||
|
||||
/* HTTP-Admin-Server: */
|
||||
int use_http;
|
||||
|
||||
/* Keep Address Family */
|
||||
int keep_address_family;
|
||||
};
|
||||
@ -219,7 +216,6 @@ void init_turn_server(turn_turnserver* server,
|
||||
allocate_bps_cb allocate_bps_func,
|
||||
int oauth,
|
||||
const char* oauth_server_name,
|
||||
int use_http,
|
||||
int keep_address_family);
|
||||
|
||||
ioa_engine_handle turn_server_get_engine(turn_turnserver *s);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user