working on https
This commit is contained in:
parent
0aee63f61e
commit
385bb2fe9b
@ -122,9 +122,7 @@ LOW_DEFAULT_PORTS_BOUNDARY,HIGH_DEFAULT_PORTS_BOUNDARY,0,0,0,"",
|
||||
///////////// Users DB //////////////
|
||||
{ (TURN_USERDB_TYPE)0, {"\0"}, {0,NULL,NULL, {NULL,0}} },
|
||||
///////////// CPUs //////////////////
|
||||
DEFAULT_CPUS_NUMBER,
|
||||
///////////// HTTPS ADMIN SERVER ////
|
||||
"123"
|
||||
DEFAULT_CPUS_NUMBER
|
||||
};
|
||||
|
||||
//////////////// OpenSSL Init //////////////////////
|
||||
|
||||
@ -310,10 +310,6 @@ typedef struct _turn_params_ {
|
||||
|
||||
unsigned long cpus;
|
||||
|
||||
/////// HTTPS SERVER /////
|
||||
|
||||
char https_admin_pwd[129];
|
||||
|
||||
} turn_params_t;
|
||||
|
||||
extern turn_params_t turn_params;
|
||||
|
||||
@ -223,6 +223,10 @@ struct _ioa_socket
|
||||
accept_cb acb;
|
||||
void *acbarg;
|
||||
/* <<== RFC 6062 */
|
||||
//Admin server:
|
||||
int as_ok;
|
||||
char as_login[17];
|
||||
char as_realm[STUN_MAX_REALM_SIZE + 1];
|
||||
};
|
||||
|
||||
typedef struct _timer_event
|
||||
|
||||
@ -1357,7 +1357,7 @@ int send_turn_session_info(struct turn_session_info* tsi)
|
||||
|
||||
/////////// HTTPS /////////////
|
||||
|
||||
static void write_https_default_page(ioa_socket_handle s)
|
||||
static void write_https_logon_page(ioa_socket_handle s)
|
||||
{
|
||||
if(s && !ioa_socket_tobeclosed(s)) {
|
||||
//TODO
|
||||
@ -1386,19 +1386,20 @@ static void handle_https(ioa_socket_handle s, ioa_network_buffer_handle nbh) {
|
||||
}
|
||||
}
|
||||
|
||||
if(!turn_params.https_admin_pwd[0]) {
|
||||
handle_http_echo(s);
|
||||
} else {
|
||||
if(s->as_ok) {
|
||||
if(nbh) {
|
||||
struct http_request* hr = parse_http_request((char*)ioa_network_buffer_data(nbh));
|
||||
if(!hr) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "%s: wrong HTTPS request (I cannot parse it)\n", __FUNCTION__);
|
||||
} else {
|
||||
//TODO
|
||||
write_https_logon_page(s);
|
||||
s->as_ok = 1;
|
||||
free_http_request(hr);
|
||||
}
|
||||
}
|
||||
write_https_default_page(s);
|
||||
} else {
|
||||
write_https_logon_page(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user