mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-03-13 14:58:07 +08:00
use more reasonable names to open and close a session
This commit is contained in:
@@ -281,7 +281,7 @@ struct cookie_entry_st *old;
|
|||||||
|
|
||||||
memcpy(proc->ipv4_seed, &cmsg->ipv4_seed, sizeof(proc->ipv4_seed));
|
memcpy(proc->ipv4_seed, &cmsg->ipv4_seed, sizeof(proc->ipv4_seed));
|
||||||
|
|
||||||
ret = session_openclose(s, proc, 1);
|
ret = session_open(s, proc);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
mslog(s, proc, LOG_INFO, "could not open session");
|
mslog(s, proc, LOG_INFO, "could not open session");
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -161,7 +161,8 @@ struct proc_st *ctmp;
|
|||||||
return ctmp;
|
return ctmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int session_openclose(main_server_st * s, struct proc_st *proc, unsigned open)
|
static
|
||||||
|
int session_cmd(main_server_st * s, struct proc_st *proc, unsigned open)
|
||||||
{
|
{
|
||||||
int sd, ret, e;
|
int sd, ret, e;
|
||||||
SecAuthSessionMsg ireq = SEC_AUTH_SESSION_MSG__INIT;
|
SecAuthSessionMsg ireq = SEC_AUTH_SESSION_MSG__INIT;
|
||||||
@@ -232,6 +233,16 @@ int session_openclose(main_server_st * s, struct proc_st *proc, unsigned open)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int session_open(main_server_st * s, struct proc_st *proc)
|
||||||
|
{
|
||||||
|
return session_cmd(s, proc, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int session_close(main_server_st * s, struct proc_st *proc)
|
||||||
|
{
|
||||||
|
return session_cmd(s, proc, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* k: whether to kill the process
|
/* k: whether to kill the process
|
||||||
*/
|
*/
|
||||||
void remove_proc(main_server_st * s, struct proc_st *proc, unsigned k)
|
void remove_proc(main_server_st * s, struct proc_st *proc, unsigned k)
|
||||||
@@ -250,7 +261,7 @@ void remove_proc(main_server_st * s, struct proc_st *proc, unsigned k)
|
|||||||
|
|
||||||
/* close any pending sessions */
|
/* close any pending sessions */
|
||||||
if (s->config->session_control != 0 && proc->active_sid) {
|
if (s->config->session_control != 0 && proc->active_sid) {
|
||||||
session_openclose(s, proc, 0);
|
session_close(s, proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close the intercomm fd */
|
/* close the intercomm fd */
|
||||||
|
|||||||
@@ -236,7 +236,8 @@ int handle_resume_fetch_req(main_server_st* s, struct proc_st * proc,
|
|||||||
int handle_resume_store_req(main_server_st* s, struct proc_st *proc,
|
int handle_resume_store_req(main_server_st* s, struct proc_st *proc,
|
||||||
const SessionResumeStoreReqMsg *);
|
const SessionResumeStoreReqMsg *);
|
||||||
|
|
||||||
int session_openclose(main_server_st * s, struct proc_st *proc, unsigned open);
|
int session_open(main_server_st * s, struct proc_st *proc);
|
||||||
|
int session_close(main_server_st * s, struct proc_st *proc);
|
||||||
|
|
||||||
void
|
void
|
||||||
__attribute__ ((format(printf, 4, 5)))
|
__attribute__ ((format(printf, 4, 5)))
|
||||||
|
|||||||
@@ -312,7 +312,9 @@ int handle_sec_auth_res(sec_mod_st * sec, client_entry_st * e, int result)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int handle_sec_auth_session_openclose(sec_mod_st * sec, const SecAuthSessionMsg * req, unsigned cmd)
|
/* opens or closes a session.
|
||||||
|
*/
|
||||||
|
int handle_sec_auth_session_cmd(sec_mod_st * sec, const SecAuthSessionMsg * req, unsigned cmd)
|
||||||
{
|
{
|
||||||
client_entry_st *e;
|
client_entry_st *e;
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ int process_packet(void *pool, sec_mod_st * sec, cmd_request_t cmd,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = handle_sec_auth_session_openclose(sec, msg, cmd);
|
ret = handle_sec_auth_session_cmd(sec, msg, cmd);
|
||||||
sec_auth_session_msg__free_unpacked(msg, &pa);
|
sec_auth_session_msg__free_unpacked(msg, &pa);
|
||||||
|
|
||||||
if (cmd == SM_CMD_AUTH_SESSION_OPEN) {
|
if (cmd == SM_CMD_AUTH_SESSION_OPEN) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ void sec_auth_init(struct cfg_st *config);
|
|||||||
|
|
||||||
int handle_sec_auth_init(sec_mod_st *sec, const SecAuthInitMsg * req);
|
int handle_sec_auth_init(sec_mod_st *sec, const SecAuthInitMsg * req);
|
||||||
int handle_sec_auth_cont(sec_mod_st *sec, const SecAuthContMsg * req);
|
int handle_sec_auth_cont(sec_mod_st *sec, const SecAuthContMsg * req);
|
||||||
int handle_sec_auth_session_openclose(sec_mod_st * sec, const SecAuthSessionMsg * req, unsigned cmd);
|
int handle_sec_auth_session_cmd(sec_mod_st * sec, const SecAuthSessionMsg * req, unsigned cmd);
|
||||||
void sec_auth_user_deinit(client_entry_st * e);
|
void sec_auth_user_deinit(client_entry_st * e);
|
||||||
|
|
||||||
void sec_mod_server(void *main_pool, struct cfg_st *config, const char *socket_file,
|
void sec_mod_server(void *main_pool, struct cfg_st *config, const char *socket_file,
|
||||||
|
|||||||
Reference in New Issue
Block a user