亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? htcache.c

?? www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
?? C
?? 第 1 頁 / 共 5 頁
字號:
{    HTAssocList * cc = HTRequest_cacheControl(request);    if (cache) {	time_t max_age = -1;	time_t max_stale = -1;	time_t min_fresh = -1;	/*	**  Make sure that we have the metainformation loaded from the	**  persistent cache	*/	HTParentAnchor * anchor = HTRequest_anchor(request);	if (!HTAnchor_headerParsed(anchor)) {	    if (HTCache_readMeta(cache, request) != YES)		return HT_CACHE_ERROR;	    HTAnchor_setHeaderParsed(anchor);	}	/* the cache size is 0 when we want to force the     	   revalidation of the cache, for example, after a PUT */#if 0	/* @@ JK: trying the following instruction */    	if (cache->size == 0)     	  return HT_CACHE_FLUSH;#endif	/*	**  If we only have a part of this request then make a range request	**  using the If-Range condition GET request	*/	if (cache->range) {	    char buf[20];	    sprintf(buf, "%ld-", cache->size);	    HTTRACE(CACHE_TRACE, "Cache....... Asking for range `%s\'\n" _ buf);	    HTRequest_addRange(request, "bytes", buf);	    HTRequest_addRqHd(request, HT_C_RANGE);	    	    return HT_CACHE_RANGE_VALIDATE;	}	/*	**  In case this entry is of type "must-revalidate" then we just	**  go ahead and validate it.	*/	if (cache->must_revalidate)	    return HT_CACHE_VALIDATE;	/*	**  Check whether we have any special constraints like min-fresh in	**  the cache control	*/	if (cc) {	    char * token = NULL;	    if ((token = HTAssocList_findObject(cc, "max-age")))		max_age = atol(token);	    if ((token = HTAssocList_findObject(cc, "max-stale")))		max_stale = atol(token);	    if ((token = HTAssocList_findObject(cc, "min-fresh")))		min_fresh = atol(token);	}	/*	**  Now do the checking against the age constraints that we've got	*/	{	    time_t resident_time = time(NULL) - cache->response_time;	    time_t current_age = cache->corrected_initial_age + resident_time;	    /*	    ** Check that the max-age, max-stale, and min-fresh directives	    ** given in the request cache control header is followed.	    */	    if (max_age >= 0 && current_age > max_age) {		HTTRACE(CACHE_TRACE, "Cache....... Max-age validation\n");		return HT_CACHE_VALIDATE;	    }	    if (min_fresh >= 0 &&		cache->freshness_lifetime < current_age + min_fresh) {		HTTRACE(CACHE_TRACE, "Cache....... Min-fresh validation\n");		return HT_CACHE_VALIDATE;	    }	    return (cache->freshness_lifetime +		    (max_stale >= 0 ? max_stale : 0) > current_age) ?		HT_CACHE_OK : HT_CACHE_VALIDATE;	}    }    return HT_CACHE_FLUSH;}/***  While we are creating a new cache object or while we are validating an**  existing one, we must have a lock on the entry so that not other**  requests can get to it in the mean while.*/PUBLIC BOOL HTCache_getLock (HTCache * cache, HTRequest * request){    if (cache && request) {	HTTRACE(CACHE_TRACE, "Cache....... Locking cache entry %p\n" _ cache);	cache->lock = request;	return YES;    }    return NO;}PUBLIC BOOL HTCache_releaseLock (HTCache * cache){    if (cache) {	HTTRACE(CACHE_TRACE, "Cache....... Unlocking cache entry %p\n" _ cache);	cache->lock = NULL;	return YES;    }    return NO;}PUBLIC BOOL HTCache_hasLock (HTCache * cache){    return cache && cache->lock;}PUBLIC BOOL HTCache_breakLock (HTCache * cache, HTRequest * request){    if (cache && cache->lock) {	if (cache->lock == request) {	    HTTRACE(CACHE_TRACE, "Cache....... Breaking lock on entry %p\n" _ cache);	    cache->lock = NULL;	    return YES;	}    }    return NO;}/***  Is we have a valid entry in the cache then we also need a location**  where we can get it. Hopefully, we may be able to access it**  thourgh one of our protocol modules, for example the local file**  module. The name returned is in URL syntax and must be freed by**  the caller*/PUBLIC char * HTCache_name (HTCache * cache){    if (cache) {	char * local = cache->cachename;	char * url = HTLocalToWWW(local, "cache:");	return url;    }    return NULL;}/***  Remove from memory AND from disk. You must explicitly remove a lock**  before this operation can succeed*/PUBLIC BOOL HTCache_remove (HTCache * cache){    return flush_object(cache) && HTCache_delete(cache);}PUBLIC BOOL HTCache_addHit (HTCache * cache){    if (cache) {	cache->hits++;	HTTRACE(CACHE_TRACE, "Cache....... Hits for %p is %d\n" _ 				 cache _ cache->hits);	return YES;    }    return NO;}/* ------------------------------------------------------------------------- *//*  			        CACHE WRITER				     *//* ------------------------------------------------------------------------- */PRIVATE BOOL free_stream (HTStream * me, BOOL abort){    if (me) {	HTCache * cache = me->cache;	/*	**  We close the file object. This does not mean that we have the	**  complete object. In case of an "abort" then we only have a part,	**  however, next time we do a load we can use byte ranges to complete	**  the request.	*/	if (me->fp) fclose(me->fp);	/*	**  We are done storing the object body and can update the cache entry.	**  Also update the meta information entry on disk as well. When we	**  are done we don't need the lock anymore.	*/	if (cache) {	    HTCache_writeMeta(cache, me->request, me->response);	    HTCache_releaseLock(cache);	    /*	    **  Remember if this is the full entity body or only a subpart	    **  We assume that an abort will only give a part of the object.	    */	    cache->range = abort;	    /*	    **  Set the size and maybe do gc. If it is an abort then set the	    **  byte range so that we can start from this point next time. We	    **  take the byte range as the number of bytes that we have already	    **  written to the cache entry.	    */	    HTCache_setSize(cache, me->bytes_written, me->append);	}	/*	**  In order not to loose information, we dump the current cache index	**  every time we have created DUMP_FREQUENCY new entries	*/	if (new_entries > DUMP_FREQUENCY) {	    HTCacheIndex_write(HTCacheRoot);	    new_entries = 0;	}	HT_FREE(me);	return YES;    }    return NO;}PRIVATE int HTCache_free (HTStream * me){    return free_stream(me, NO) ? HT_OK : HT_ERROR;}PRIVATE int HTCache_abort (HTStream * me, HTList * e){    HTTRACE(CACHE_TRACE, "Cache....... ABORTING\n");    free_stream(me, YES);    return HT_ERROR;}PRIVATE int HTCache_flush (HTStream * me){    return (fflush(me->fp) == EOF) ? HT_ERROR : HT_OK;}PRIVATE int HTCache_putBlock (HTStream * me, const char * s, int  l){    int status = (fwrite(s, 1, l, me->fp) != l) ? HT_ERROR : HT_OK;    if (l > 1 && status == HT_OK) {	HTCache_flush(me);	me->bytes_written += l;    }    return status;}PRIVATE int HTCache_putChar (HTStream * me, char c){    return HTCache_putBlock(me, &c, 1);}PRIVATE int HTCache_putString (HTStream * me, const char * s){    return HTCache_putBlock(me, s, (int) strlen(s));}PRIVATE const HTStreamClass HTCacheClass ={		    "Cache",    HTCache_flush,    HTCache_free,    HTCache_abort,    HTCache_putChar,    HTCache_putString,    HTCache_putBlock};PRIVATE HTStream * HTCacheStream (HTRequest * request, BOOL append){    HTCache * cache = NULL;    FILE * fp = NULL;    HTResponse * response = HTRequest_response(request);    HTParentAnchor * anchor = HTRequest_anchor(request);    /* If cache is not enabled then exit now */    if (!HTCacheEnable || !HTCacheInitialized) {	HTTRACE(CACHE_TRACE, "Cache....... Not enabled\n");	return NULL;    }    /* don't cache protected documents */    if (HTRequest_credentials (request) && !HTCacheProtected) {	HTTRACE(CACHE_TRACE, "Cache....... won't cache protected objects\n");	return NULL;    }    /*    ** Check to see if we already now can see that the entry is going    ** to be too big.    */    if (HTAnchor_length(anchor) > HTCacheMaxEntrySize) {	HTTRACE(CACHE_TRACE, "Cache....... Entry is too big - won't cache\n");	return NULL;    }    /* Get a new cache entry */    if ((cache = HTCache_new(request, response, anchor)) == NULL) {	HTTRACE(CACHE_TRACE, "Cache....... Can't get a cache object\n");	return NULL;    }    /* Test that the cached object is not locked */    if (HTCache_hasLock(cache)) {	if (HTCache_breakLock(cache, request) == NO) {	    HTTRACE(CACHE_TRACE, "Cache....... Entry already in use\n");	    return NULL;	}    }    HTCache_getLock(cache, request);    /*    ** Test that we can actually write to the cache file. If the entry already    ** existed then it will be overridden with the new data.    */    if ((fp = fopen(cache->cachename, append ? "ab" : "wb")) == NULL) {	HTTRACE(CACHE_TRACE, "Cache....... Can't open `%s\' for writing\n" _ cache->cachename);	HTCache_delete(cache);	return NULL;    } else {	HTTRACE(CACHE_TRACE, "Cache....... %s file `%s\'\n" _ 		    append ? "Append to" : "Creating" _ cache->cachename);    }    /* Set up the stream */    {	HTStream * me = NULL;	if ((me = (HTStream *) HT_CALLOC(1, sizeof(HTStream))) == NULL)	    HT_OUTOFMEM("Cache");	me->isa = &HTCacheClass;	me->request = request;	me->response = response;	me->cache = cache;	me->fp = fp;	me->append = append;	return me;    }    return NULL;}PUBLIC HTStream * HTCacheWriter (HTRequest *	request,				 void *		param,				 HTFormat	input_format,				 HTFormat	output_format,				 HTStream *	output_stream){    return HTCacheStream(request, NO);}PUBLIC HTStream * HTCacheAppend (HTRequest *	request,				 void *		param,				 HTFormat	input_format,				 HTFormat	output_format,				 HTStream *	output_stream){    return HTCacheStream(request, YES);}/* ------------------------------------------------------------------------- *//*  			        CACHE READER				     *//* ------------------------------------------------------------------------- *//***      This function copies the headers associated with a cached**      object to closes the connection and frees memory.**      Returns YES on OK, else NO*/PRIVATE void HTCache_copyHeaders (HTRequest * req){  HTParentAnchor * anchor;  char * url;  anchor = HTRequest_anchor (req);  url = HTAnchor_physical(anchor);  if (url && !strncmp (url,  "cache:", sizeof ("cache:") - 1 ))    {      /*	HTMIME_anchor2response (req);      */      /* set up a "dummy" stack just for copying the MIME type.       We need this to remove any dependencies between the MIME        and CACHE minilibs */      HTStreamStack(WWW_MIME_COPYHEADERS, WWW_DEBUG,		    HTBlackHole(), req, NO);    }}/***      This function closes the connection and frees memory.**      Returns YES on OK, else NO*/PRIVATE int CacheCleanup (HTRequest * req, int status){    HTNet * net = HTRequest_net(req);    cache_info * cache = (cache_info *) HTNet_context(net);    HTStream * input = HTRequest_inputStream(req);    /* Free stream with data TO Local cache system */    if (input) {	if (status == HT_INTERRUPTED)	    (*input->isa->abort)(input, NULL);	else	    (*input->isa->_free)(input);	HTRequest_setInputStream(req, NULL);    }    /*    **  Remove if we have registered a timer function as a callback    */    if (cache->timer) {        HTTimer_delete(cache->timer);        cache->timer = NULL;    }        if (cache) {        HT_FREE(cache->local);        HT_FREE(cache);    }    /* if the object was cached, we copy the pertinent HTTP headers       from the anchor object (where they are stored) to the       response object */    if (status == HT_NOT_MODIFIED)	HTCache_copyHeaders (req);    HTNet_delete(net, status);    return YES;}/***  This load function loads an object from the cache and puts it to the**  output defined by the request object. For the moment, this load function**  handles the persistent cache as if it was on local file but in fact **  it could be anywhere.****  Returns		HT_ERROR	Error has occured in call back**			HT_OK		Call back was OK*/PRIVATE int CacheEvent (SOCKET soc, void * pVoid, HTEventType type);PUBLIC int HTLoadCache (SOCKET soc, HTRequest * request){    cache_info * cache;			      /* Specific access information */    HTParentAnchor * anchor = HTRequest_anchor(request);    HTNet * net = HTRequest_net(request);    /*    ** Initiate a new cache structure and bind to request structure    ** This is actually state CACHE_BEGIN, but it can't be in the state    ** machine as we need the structure first.    */    HTTRACE(PROT_TRACE, "Load Cache.. Looking for `%s\'\n" _ 			    HTAnchor_physical(anchor));    if ((cache = (cache_info *) HT_CALLOC(1, sizeof(cache_info))) == NULL)	HT_OUTOFMEM("HTLoadCACHE");    cache->state = CL_BEGIN;    cache->net = net;    HTNet_setC

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
尤物在线观看一区| 亚洲高清免费观看高清完整版在线观看 | 国产一区二区三区av电影| 亚洲日本丝袜连裤袜办公室| 欧美一区二区成人| 在线视频国内一区二区| 国产经典欧美精品| 视频一区欧美精品| 亚洲另类在线视频| 国产欧美视频在线观看| 日韩欧美色综合网站| 欧美午夜电影一区| 99精品视频中文字幕| 国产一区在线观看麻豆| 日韩中文字幕av电影| 日韩理论片中文av| 国产精品剧情在线亚洲| 精品国产91久久久久久久妲己| 欧美精品成人一区二区三区四区| 99久久综合色| 国产91在线观看| 国产精品一区二区视频| 久久狠狠亚洲综合| 日日夜夜免费精品| 亚洲一二三专区| 一区二区在线观看视频在线观看| 中文字幕亚洲成人| 国产精品毛片无遮挡高清| 国产婷婷一区二区| 国产欧美一区视频| 欧美国产乱子伦| 国产欧美一区二区精品性| 久久嫩草精品久久久精品| 精品动漫一区二区三区在线观看| 日韩一区二区三区av| 欧美一区二区女人| 欧美一级欧美一级在线播放| 欧美日韩精品一区二区三区蜜桃 | 日韩欧美不卡在线观看视频| 欧美一级国产精品| 日韩一区二区电影网| 日韩欧美久久久| 精品福利在线导航| 国产性做久久久久久| 国产精品视频你懂的| 亚洲欧洲性图库| 亚洲精品v日韩精品| 亚洲国产一区在线观看| 视频一区在线播放| 日本不卡在线视频| 国产一区高清在线| 床上的激情91.| 色婷婷综合久久久久中文一区二区| 日本韩国一区二区三区视频| 欧美日韩视频在线一区二区| 91精品国产综合久久香蕉的特点 | 成人一区在线看| 91色综合久久久久婷婷| 欧美日韩美女一区二区| 欧美一级国产精品| 国产区在线观看成人精品| 1000精品久久久久久久久| 一区二区三区精密机械公司| 丝袜美腿成人在线| 国产伦精品一区二区三区视频青涩| 国产98色在线|日韩| 在线视频综合导航| 欧美大片一区二区| 亚洲欧洲国产专区| 日韩成人免费在线| 成人蜜臀av电影| 欧美三级电影在线看| www国产亚洲精品久久麻豆| 1000部国产精品成人观看| 天天做天天摸天天爽国产一区 | 久久久精品国产免费观看同学| 亚洲欧美影音先锋| 日本欧美加勒比视频| 国产成人av一区二区三区在线观看| 色综合网色综合| 日韩视频不卡中文| 国产精品免费看片| 日韩成人一区二区三区在线观看| 丰满白嫩尤物一区二区| 欧美日韩一区二区欧美激情| 2023国产精品| 午夜精品一区二区三区电影天堂| 国产精品123区| 欧美伦理电影网| 亚洲欧洲精品一区二区三区不卡| 免费一区二区视频| 91久久一区二区| 国产色婷婷亚洲99精品小说| 91久久精品网| 久久影院午夜片一区| 亚洲国产视频网站| 成人久久18免费网站麻豆| 日韩视频在线你懂得| 一区二区久久久| 成人妖精视频yjsp地址| 欧美大片在线观看一区二区| 一区二区三区欧美日韩| 懂色av一区二区夜夜嗨| 日韩高清电影一区| 色婷婷综合久久| 国产精品精品国产色婷婷| 精品一区二区三区在线播放| 日本韩国欧美一区| 日韩一区在线免费观看| 国产成人免费xxxxxxxx| 欧美精品一区二区三区视频| 日本在线播放一区二区三区| 在线观看日韩毛片| 成人免费在线观看入口| 国产精品69久久久久水密桃| 日韩精品一区二区三区中文精品| 亚洲午夜视频在线| 在线观看区一区二| 一区二区三区四区激情| 99re热这里只有精品视频| 久久久亚洲精华液精华液精华液 | 蜜臀av一区二区在线观看| 精品视频123区在线观看| 日韩毛片视频在线看| 成人激情校园春色| 国产精品久久精品日日| 大胆亚洲人体视频| 欧美国产一区视频在线观看| 国产成人一区在线| 久久久久久久久免费| 国产成人夜色高潮福利影视| 国产三级一区二区三区| 国产福利91精品一区| 久久无码av三级| 国产精品中文字幕一区二区三区| 精品无人码麻豆乱码1区2区 | 久久综合久久鬼色中文字| 免费在线观看成人| 日韩久久久久久| 国产一区福利在线| 欧美国产日本视频| 91影院在线免费观看| 樱花影视一区二区| 欧美午夜电影网| 日韩av中文字幕一区二区| 日韩一二三区视频| 国产一区二区在线电影| 欧美精彩视频一区二区三区| 9i在线看片成人免费| 亚洲欧美色图小说| 欧美日韩成人一区二区| 久久99精品久久久久久| 国产欧美va欧美不卡在线| 91在线观看地址| 亚洲va欧美va天堂v国产综合| 日韩一区二区高清| 国产成人精品一区二| 亚洲欧美日韩一区二区三区在线观看| 在线精品视频一区二区三四| 日韩激情一区二区| 久久蜜臀精品av| 色8久久精品久久久久久蜜| 日日夜夜免费精品| 九九九精品视频| 国产精品久久久久aaaa樱花| 欧美日韩一区二区在线视频| 久久电影国产免费久久电影| 国产精品美女久久久久久2018| 色综合久久66| 久久精品国产一区二区| 国产精品久久久久影院亚瑟| 欧美日韩激情一区二区三区| 国产一区二区影院| 亚洲一区二三区| 26uuu国产电影一区二区| 日本韩国一区二区三区视频| 美女精品一区二区| 中文字幕中文在线不卡住| 欧美日韩国产成人在线免费| 国产91精品欧美| 丝袜亚洲另类丝袜在线| 国产精品灌醉下药二区| 欧美精三区欧美精三区| 成人午夜激情在线| 调教+趴+乳夹+国产+精品| 国产精品青草久久| 欧美一区日韩一区| 99久久免费精品高清特色大片| 男人的j进女人的j一区| 亚洲精品国产视频| 久久一区二区三区四区| 欧美性色欧美a在线播放| 国产成人aaa| 久久国产麻豆精品| 亚洲一区在线视频| 国产精品久久久久婷婷二区次| 91麻豆精品国产91久久久使用方法| av不卡免费电影| 国产·精品毛片| 蜜桃精品视频在线|