增加HTTP Session延迟回收机制,完善HTTP Session销毁流程
This commit is contained in:
@@ -9,13 +9,19 @@ extern "C"
|
||||
#include <http_half.h>
|
||||
#include <http_parser.h>
|
||||
|
||||
TAILQ_HEAD(hs_private_list, http_session_private);
|
||||
|
||||
struct http_plugin
|
||||
{
|
||||
|
||||
/* Garbage List for HTTP-SESSION object.
|
||||
* these objects can not be destroyed when TCP connection terminated. */
|
||||
struct hs_private_list gc_list_hs_private[TFE_THREAD_MAX];
|
||||
/* Lock for garbage list */
|
||||
pthread_mutex_t lock_list_hs_private[TFE_THREAD_MAX];
|
||||
/* GC events */
|
||||
struct event * gc_event_hs_private[TFE_THREAD_MAX];
|
||||
};
|
||||
|
||||
TAILQ_HEAD(hs_private_list, http_session_private);
|
||||
|
||||
struct http_plugin_status
|
||||
{
|
||||
|
||||
@@ -41,6 +47,12 @@ struct http_session_private
|
||||
tfe_http_event suspend_event;
|
||||
/* SUSPEND TAG EFFECTIVE */
|
||||
bool suspend_tag_effective;
|
||||
/* STREAM WRITE EFFECTIVE */
|
||||
bool stream_write_tag_effective;
|
||||
/* RELEASE LOCK, when the tag is zero, the session can be destroyed */
|
||||
int release_lock;
|
||||
/* thread id */
|
||||
unsigned int thread_id;
|
||||
};
|
||||
|
||||
struct http_connection_private
|
||||
|
||||
@@ -118,10 +118,11 @@ void hf_private_set_callback(struct http_half_private * hf_private, hf_private_c
|
||||
|
||||
void hf_private_set_session(struct http_half_private * hf_private, struct http_session_private * hs_private);
|
||||
|
||||
struct http_session_private * hs_private_create(struct http_connection_private * hc_private,
|
||||
struct http_half_private * hf_private_req, struct http_half_private * hf_private_resp);
|
||||
struct http_session_private * hs_private_create(struct http_connection_private * hc_private, unsigned int thread_id,
|
||||
struct http_half_private * hf_private_req, struct http_half_private * hf_private_resp);
|
||||
|
||||
void hs_private_destory(struct http_session_private * hs_private);
|
||||
void hs_private_destroy(struct http_session_private * hs_private);
|
||||
void hs_private_gc_destroy(struct http_session_private * hs_private, struct hs_private_list * gc_list);
|
||||
|
||||
void hs_private_hf_private_set(struct http_session_private * hs_private,
|
||||
struct http_half_private * hf, enum tfe_http_direction);
|
||||
|
||||
Reference in New Issue
Block a user