pgpool2.git / summary / log / commit / refs

commit    a758388bed4d69636b022e856cec32c31a87697e
Author:   Tatsuo Ishii <ishii at sraoss.co.jp>
Date:     Fri Jul 23 06:04:17 2010 +0000

    Add new function pool_session_context_destroy, which destorys
    session context.
    Shoould be called at the end of session.
    For now it is just called at the very beginning of session.
    Also it needs more work to release memory.


child.c | 3 +++ pool_session_context.c | 9 +++++++++ pool_session_context.h | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/child.c b/child.c index f10e5d105..f1b3cb941 100644 --- a/child.c +++ b/child.c @@ -449,6 +449,9 @@ static POOL_CONNECTION *do_accept(int unix_fd, int inet_fd, struct timeval *time set_ps_display("wait for connection request", false); + /* Destroy session context for just in case... */ + pool_session_context_destroy(); + FD_ZERO(&readmask); FD_SET(unix_fd, &readmask); if (inet_fd) diff --git a/pool_session_context.c b/pool_session_context.c index e680e6ec1..ae50ec851 100644 --- a/pool_session_context.c +++ b/pool_session_context.c @@ -113,6 +113,15 @@ void pool_init_session_context(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL * session_context->mismatch_ntuples = false; } +/* + * Destroy session context. + */ +void pool_session_context_destroy(void) +{ + /* XXX For now, just zap memory */ + memset(&session_context_d, 0, sizeof(session_context_d)); +} + /* * Return session context */ diff --git a/pool_session_context.h b/pool_session_context.h index e82bd1926..5ce6b378e 100644 --- a/pool_session_context.h +++ b/pool_session_context.h @@ -160,6 +160,11 @@ typedef struct { */ int ntuples[MAX_NUM_BACKENDS]; + /* + * If true, we are executing reset query list. + */ + bool reset_context; + #ifdef NOT_USED /* We need to override these gotchas... */ int force_replication; @@ -213,6 +218,7 @@ typedef struct { } POOL_SESSION_CONTEXT; extern void pool_init_session_context(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *backend); +extern void pool_session_context_destroy(void); extern POOL_SESSION_CONTEXT *pool_get_session_context(void); extern int pool_get_local_session_id(void); extern bool pool_is_query_in_progress(void); [parent: 6a2bbaa587e9]