本文整理汇总了C++中session_free函数的典型用法代码示例。如果您正苦于以下问题:C++ session_free函数的具体用法?C++ session_free怎么用?C++ session_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了session_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: session_delete
void session_delete(t_session *session)
{
t_context *context;
t_session *tmp;
t_session *tmp2;
session_end(session);
context = get_context_ptr((void *)0);
VERBOSE(printf("\033[%d;1m<%03d> - session delete\033[m\n",
COLOR(session->id), session->id));
tmp = context->sessions;
if (tmp == session)
{
context->sessions = tmp->next;
session_free(tmp);
return ;
}
tmp2 = tmp;
tmp = tmp->next;
for (tmp2 = tmp, tmp = tmp->next; tmp && tmp != session;
tmp = tmp->next, tmp2 = tmp2->next)
;
if (tmp == session)
{
tmp2->next = tmp->next;
session_free(tmp);
}
return ;
}
开发者ID:episeclab,项目名称:advanced-csrf,代码行数:29,代码来源:session.c
示例2: fe_close_window
void
fe_close_window (struct session *sess)
{
/*
* There's really no point in doing all of this if the user is
* quitting the app. It makes it slow (as they watch individual
* channels and servers disappear), and the OS is about to free
* everything much more efficiently than we ever could.
*
* If we ever choose to run on Windows ME, this could be a problem :)
*/
if (gui.quit) {
session_free (sess);
return;
}
navigation_tree_remove_session (gui.server_tree, sess);
conversation_panel_remove_session (CONVERSATION_PANEL (gui.conversation_panel), sess);
topic_label_remove_session (TOPIC_LABEL (gui.topic_label), sess);
text_entry_remove_session (TEXT_ENTRY (gui.text_entry), sess);
if (sess->type == SESS_SERVER) {
status_bar_remove_server (STATUS_BAR (gui.status_bar), sess->server);
}
if (sess == gui.current_session) {
gui.current_session = NULL;
}
session_free (sess);
}
开发者ID:GNOME,项目名称:xchat-gnome,代码行数:30,代码来源:fe-gnome.c
示例3: session_eventcb
/*
* Handle socket events, such as connection failure or success.
* - BEV_EVENT_ERROR - network is unreachable
* - BEV_EVENT_ERROR+READING - connection refused or connection timed out
* - BEV_EVENT_TIMEOUT+READING - write timeout, if activated by
* bufferevent_set_timeouts
*/
static void
session_eventcb(struct bufferevent *bev, short what, void *thunk)
{
struct session *session = thunk;
switch (what & ~(BEV_EVENT_READING|BEV_EVENT_WRITING)) {
case BEV_EVENT_CONNECTED:
session_send(session);
return;
case BEV_EVENT_EOF:
bufferevent_disable(bev, EV_READ|EV_WRITE);
if (session->completed)
target_mark(session->t, session->seq, '.');
else
target_mark(session->t, session->seq, '%');
break;
case BEV_EVENT_ERROR:
bufferevent_disable(bev, EV_READ|EV_WRITE);
target_mark(session->t, session->seq, '#');
break;
case BEV_EVENT_TIMEOUT:
target_mark(session->t, session->seq, '?');
break;
}
session_free(session);
}
开发者ID:simonvik,项目名称:xping,代码行数:32,代码来源:http.c
示例4: sink_input_kill
/* Called from main context */
static void sink_input_kill(pa_sink_input* i) {
struct session *s;
pa_sink_input_assert_ref(i);
pa_assert_se(s = i->userdata);
session_free(s);
}
开发者ID:cktakahasi,项目名称:pa,代码行数:8,代码来源:module-rtp-recv.c
示例5: conf_reset_thread_globals
inline NSAPIEnvironment::~NSAPIEnvironment()
{
// Tidy up the thread-specific "globals" for the next caller
conf_reset_thread_globals();
// Discard the request
if (rq)
request_free(rq);
// Discard the session
if (sn) {
if (sn->csd && sn->csd_open)
PR_Close(sn->csd);
sn->csd_open = 0;
session_free(sn);
}
// Restore the caller's pool. session_free() set it to NULL
if (poolCaller)
systhread_setdata(keyPool, poolCaller);
// This may have been a request thread. If it was, we need to restore the
// HttpRequest* for the thread-specific "globals".
if (hrq) {
HttpRequest::SetCurrentRequest(hrq);
conf_set_thread_globals(hrq);
}
else {
conf_set_thread_globals(threadHrq, threadVS);
}
}
开发者ID:OldsSourcesBackups,项目名称:Heliod-Web-Server,代码行数:31,代码来源:vs.cpp
示例6: signal_handler
PRIVATE void signal_handler(int sig) {
switch (sig) {
case SIGINT:
case SIGTERM: {
dbg_printf(P_INFO2, "SIGTERM/SIGINT caught");
closing = true;
break;
}
case SIGHUP: {
if(isRunning || !mySession) {
seenHUP = true;
} else {
auto_handle * s = NULL;
dbg_printf(P_MSG, "Caught SIGHUP. Reloading config file.");
s = session_init();
if((parse_config_file(s, AutoConfigFile) != 0) || !setupSession(s)) {
dbg_printf(P_ERROR, "Error parsing config file. Keeping the old settings.");
session_free(s);
}
seenHUP = false;
}
break;
}
}
}
开发者ID:1100101,项目名称:Automatic,代码行数:27,代码来源:automatic.c
示例7: ssh_relay_event_cb
static void
ssh_relay_event_cb(struct bufferevent *bev, short what, void *ptr)
{
obfsproxyssh_client_session_t *session = ptr;
struct evbuffer *buf;
assert(bev == session->ssh_ev);
if (what & (BEV_EVENT_EOF | BEV_EVENT_ERROR)) {
session->ssh_is_valid = 0;
libssh2_channel_free(session->ssh_channel);
session->ssh_channel = NULL;
libssh2_session_free(session->ssh_session);
session->ssh_session = NULL;
buf = bufferevent_get_output(session->socks_ev);
if (0 == session->socks_is_valid || 0 ==
evbuffer_get_length(buf))
session_free(session);
else {
bufferevent_disable(session->socks_ev, EV_READ);
bufferevent_setcb(session->socks_ev, NULL,
socks_relay_teardown_cb,
socks_event_cb, session);
}
}
}
开发者ID:Yawning,项目名称:obfsproxyssh,代码行数:26,代码来源:obfsproxyssh_client.c
示例8: on_disconnect
static void on_disconnect(netc_t *netc)
{
struct session *session;
session = netc->ext_ptr;
session_free(session);
}
开发者ID:gvsurenderreddy,项目名称:DNDS,代码行数:7,代码来源:dsd.c
示例9: client_free
/**
@brief Free a transport_client, along with all resources it owns.
@param client Pointer to the transport_client to be freed.
@return 1 if successful, or 0 if not. The only error condition is if @a client is NULL.
*/
int client_free( transport_client* client ) {
if(client == NULL)
return 0;
session_free( client->session );
client->session = NULL;
return client_discard( client );
}
开发者ID:evergreen-library-system,项目名称:OpenSRF,代码行数:12,代码来源:transport_client.c
示例10: obc_session_unref
void obc_session_unref(struct obc_session *session)
{
int refs;
refs = __sync_sub_and_fetch(&session->refcount, 1);
DBG("%p: ref=%d", session, refs);
if (refs > 0)
return;
sessions = g_slist_remove(sessions, session);
if (!session->obex)
goto disconnect;
/* Wait OBEX Disconnect to complete if command succeed otherwise
* proceed with transport disconnection since there is nothing else to
* be done */
if (g_obex_disconnect(session->obex, disconnect_complete, session,
NULL))
return;
disconnect:
/* Disconnect transport */
if (session->id > 0 && session->transport != NULL) {
session->transport->disconnect(session->id);
session->id = 0;
}
session_free(session);
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:32,代码来源:session.c
示例11: session_mem_create
int session_mem_create(session_opt_t *so, request_t *rq, response_t *rs,
session_t **pss)
{
session_t *ss = NULL;
dbg_err_if (so == NULL);
dbg_err_if (rq == NULL);
dbg_err_if (rs == NULL);
dbg_err_if (pss == NULL);
ss = u_zalloc(sizeof(session_t));
dbg_err_if(ss == NULL);
ss->load = session_mem_load;
ss->save = session_mem_save;
ss->remove = session_mem_remove;
ss->term = session_mem_term;
ss->mtime = time(0);
ss->so = so;
dbg_err_if(session_prv_init(ss, rq, rs));
*pss = ss;
return 0;
err:
if(ss)
session_free(ss);
return ~0;
}
开发者ID:DanielTillett,项目名称:klone,代码行数:30,代码来源:ses_mem.c
示例12: ssh_auth_cb
static void
ssh_auth_cb(obfsproxyssh_client_session_t *session)
{
obfsproxyssh_t *state = session->client->state;
int rval;
rval = libssh2_userauth_publickey(session->ssh_session,
bdata(session->user),
get_rsa_public_key(session->privkey),
get_rsa_public_key_len(session->privkey),
sign_with_private_key,
&session->privkey);
if (LIBSSH2_ERROR_EAGAIN == rval)
return;
else if (0 != rval) {
log_f(state, "SSH: Error: %s Failed to authenticate - %d",
bdata(session->ssh_addr), rval);
libssh2_session_free(session->ssh_session);
session->ssh_session = NULL;
session_free(session);
return;
}
session->libssh2_cb = ssh_channel_cb;
session->libssh2_cb(session);
}
开发者ID:Yawning,项目名称:obfsproxyssh,代码行数:26,代码来源:obfsproxyssh_client.c
示例13: socks_relay_teardown_cb
static void
socks_relay_teardown_cb(struct bufferevent *bev, void *ptr)
{
obfsproxyssh_client_session_t *session = ptr;
session_free(session);
}
开发者ID:Yawning,项目名称:obfsproxyssh,代码行数:7,代码来源:obfsproxyssh_client.c
示例14: connclosed_cb
// This callback is received whenever a session is closed. The RISP session itself will be destroyed right after this callback exits.
void connclosed_cb(RISPSESSION streamsession, void *dataptr)
{
assert(streamsession);
assert(dataptr);
maindata_t *maindata = dataptr;
assert(maindata);
assert(maindata->verify == 0xc001b33f);
// we need to go through the list in maindata, to find this particular session. When we have found it, we remove it.
assert(maindata->sessions.list);
assert(maindata->sessions.max > 0);
fprintf(stderr, "Session Closed. Finding in the list. Max:%d\n", maindata->sessions.max);
short found = 0;
for (int index=0; index < maindata->sessions.max; index++) {
if (maindata->sessions.list[index]) {
if (maindata->sessions.list[index]->session_ptr == streamsession) {
// free the resources used by the session, and the session object itself.
session_free(maindata->sessions.list[index]);
// clear the entry in the list.
maindata->sessions.list[index] = NULL;
// we found the one we were looking for, so mark it, and exit the loop.
found = 1;
index = maindata->sessions.max;
}
}
}
// we should have found one in that list.
assert(found == 1);
}
开发者ID:hyper,项目名称:librisp,代码行数:36,代码来源:risp_chat_server.c
示例15: freeSession
/**
* Free the memory associated with the session
*
* @param instance The filter instance
* @param session The filter session
*/
static void
freeSession(FILTER *instance, void *session)
{
TEE_SESSION *my_session = (TEE_SESSION *)session;
SESSION* ses = my_session->branch_session;
session_state_t state;
#ifdef SS_DEBUG
skygw_log_write(LOGFILE_TRACE,"Tee free: %d", atomic_add(&debug_seq,1));
#endif
if (ses != NULL)
{
state = ses->state;
if (state == SESSION_STATE_ROUTER_READY)
{
session_free(ses);
}
else if (state == SESSION_STATE_TO_BE_FREED)
{
/** Free branch router session */
ses->service->router->freeSession(
ses->service->router_instance,
ses->router_session);
/** Free memory of branch client session */
ses->state = SESSION_STATE_FREE;
free(ses);
/** This indicates that branch session is not available anymore */
my_session->branch_session = NULL;
}
else if(state == SESSION_STATE_STOPPING)
{
orphan_session_t* orphan;
if((orphan = malloc(sizeof(orphan_session_t))) == NULL)
{
skygw_log_write(LOGFILE_ERROR,"Error : Failed to "
"allocate memory for orphan session struct, "
"child session might leak memory.");
}else{
orphan->session = ses;
spinlock_acquire(&orphanLock);
orphan->next = allOrphans;
allOrphans = orphan;
spinlock_release(&orphanLock);
}
}
}
if (my_session->dummy_filterdef)
{
filter_free(my_session->dummy_filterdef);
}
if(my_session->tee_replybuf)
gwbuf_free(my_session->tee_replybuf);
free(session);
orphan_free(NULL);
return;
}
开发者ID:jhnwkmn,项目名称:MaxScale,代码行数:64,代码来源:tee.c
示例16: shutdown_daemon
PRIVATE void shutdown_daemon(auto_handle *as) {
dbg_printft(P_MSG, "Shutting down daemon");
if (as && as->bucket_changed) {
save_state(as->statefile, as->downloads);
}
session_free(as);
SessionID_free();
log_close();
exit(EXIT_SUCCESS);
}
开发者ID:1100101,项目名称:trailermatic,代码行数:11,代码来源:trailermatic.c
示例17: setup_destroy
static void setup_destroy(void *user_data)
{
struct network_adapter *na = user_data;
struct network_session *setup = na->setup;
if (!setup)
return;
na->setup = NULL;
session_free(setup);
}
开发者ID:sancane,项目名称:BlueZ,代码行数:12,代码来源:server.c
示例18: manager_sysview_session_remove
static int manager_sysview_session_remove(Manager *m, sysview_event *event) {
sysview_session *session = event->session_remove.session;
Session *s;
s = sysview_session_get_userdata(session);
if (!s)
return 0;
session_free(s);
return 0;
}
开发者ID:275288698,项目名称:systemd-ubuntu-with-dbus,代码行数:12,代码来源:consoled-manager.c
示例19: audio_client_free
static void audio_client_free(struct audio_client *ac)
{
session_free(ac->session, ac);
if (ac->buf[0].data)
dma_free_coherent(NULL, ac->buf[0].size,
ac->buf[0].data, ac->buf[0].phys);
if (ac->buf[1].data)
dma_free_coherent(NULL, ac->buf[1].size,
ac->buf[1].data, ac->buf[1].phys);
kfree(ac);
}
开发者ID:Ma7moud,项目名称:kernel,代码行数:12,代码来源:q6audio.c
示例20: session_delete
NBBOOL session_delete(sessions_t *sessions, char *name)
{
session_t *session = sessions->first_session;
session_t *next_session;
/* Check if we have any sessions. */
if(!session)
{
fprintf(stderr, "There are no sessions to delete\n");
return FALSE;
}
/* Check if the first session is the one we're deleting. */
if(!strcasecmp(sessions->first_session->name, name))
{
fprintf(stderr, "Found session to delete: %s\n", name);
session = (session_t*)sessions->first_session->next_session;
session_free(sessions, sessions->first_session);
sessions->first_session = session;
return TRUE;
}
/* Check if any of the other sessions match. */
while((next_session = (session_t *)session->next_session) != NULL)
{
if(!strcasecmp(next_session->name, name))
{
fprintf(stderr, "Found session to delete: %s\n", name);
session->next_session = next_session->next_session;
session_free(sessions, next_session);
return TRUE;
}
session = next_session;
}
return FALSE;
}
开发者ID:emmanuj,项目名称:kemi,代码行数:40,代码来源:session.c
注:本文中的session_free函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论