TSG-11849 tfe增加从环境变量中读入处理机ip
TSG-11742 IP Libraries统一使用.分隔地理层级 TSG-10722 日志中开始时间从解析层获取
This commit is contained in:
69
plugin/business/tsg-http/include/tsg_proxy_web_cache.h
Normal file
69
plugin/business/tsg-http/include/tsg_proxy_web_cache.h
Normal file
@@ -0,0 +1,69 @@
|
||||
#pragma once
|
||||
#include <event2/event.h>
|
||||
#include <event2/buffer.h>
|
||||
#include <tfe_future.h>
|
||||
#include <MESA/Maat_rule.h>
|
||||
|
||||
|
||||
struct cache_handle;
|
||||
struct cache_handle* create_web_cache_handle(const char* profile_path, const char* section,
|
||||
struct event_base* gc_evbase, Maat_feather_t feather, void *logger);
|
||||
|
||||
struct cached_meta
|
||||
{
|
||||
size_t content_length;
|
||||
char* content_type;
|
||||
char* last_modified;
|
||||
char* etag;
|
||||
};
|
||||
const struct cached_meta* cache_query_result_read_meta(future_result_t * result);
|
||||
size_t cache_query_result_get_data(future_result_t * result, const unsigned char** pp_data);
|
||||
|
||||
int web_cache_async_read(struct cache_handle* handle, unsigned int thread_id,
|
||||
const struct tfe_http_half * request, struct cache_mid** mid, struct future* f);
|
||||
|
||||
|
||||
|
||||
enum cache_query_result_type
|
||||
{
|
||||
CACHE_QUERY_RESULT_MISS,
|
||||
CACHE_QUERY_RESULT_META,
|
||||
CACHE_QUERY_RESULT_DATA,
|
||||
CACHE_QUERY_RESULT_END,
|
||||
CACHE_QUERY_RESULT_IRRELEVANT,
|
||||
__CACHE_QUERY_RESULT_MAX
|
||||
};
|
||||
enum cache_query_result_type cache_query_result_get_type(future_result_t * result);
|
||||
|
||||
enum cache_pending_result
|
||||
{
|
||||
PENDING_RESULT_NONE=0,
|
||||
PENDING_RESULT_FOBIDDEN,
|
||||
PENDING_RESULT_REVALIDATE,
|
||||
PENDING_RESULT_ALLOWED,
|
||||
PENDING_RESULT_HIT,
|
||||
PENDING_RESULT_MISS
|
||||
};
|
||||
const char* cache_pending_result_string(enum cache_pending_result);
|
||||
struct cache_mid;
|
||||
void cache_mid_clear(struct cache_mid **mid);
|
||||
|
||||
const struct cached_meta* cache_pending_result_read_meta(future_result_t * result, struct cache_mid* mid);
|
||||
enum cache_pending_result web_cache_async_pending(struct cache_handle* handle, unsigned int thread_id,
|
||||
const struct tfe_http_half * request, struct cache_mid **mid, struct future* f_revalidate);
|
||||
|
||||
|
||||
|
||||
|
||||
struct cache_write_context;
|
||||
struct cache_write_context* web_cache_write_start(struct cache_handle* handle, unsigned int thread_id,
|
||||
const struct tfe_http_session * session, struct cache_mid **mid);
|
||||
void web_cache_write(struct cache_write_context* ctx, const unsigned char * body_frag, size_t frag_size);
|
||||
//return 1 on success
|
||||
//return -1 on failed
|
||||
//return -2 on cancel
|
||||
|
||||
int web_cache_write_end(struct cache_write_context* ctx);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user