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

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

?? hthost.c

?? www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
?? C
?? 第 1 頁 / 共 4 頁
字號:
PUBLIC BOOL HTHost_setMode (HTHost * host, HTTransportMode mode){    if (host) {	/*	**  Check the new mode and see if we must adjust the queues.	*/	if (mode == HT_TP_SINGLE && host->mode > mode) {	    int piped = HTList_count(host->pipeline);	    if (piped > 0) {		int cnt;		HTTRACE(CORE_TRACE, "Host info... Moving %d Net objects from pipe line to pending queue\n" _ piped);		if (!host->pending) host->pending = HTList_new();		for (cnt=0; cnt<piped; cnt++) {		    HTNet * net = HTList_removeLastObject(host->pipeline);		    HTTRACE(CORE_TRACE, "Host info... Resetting net object %p\n" _ net);		    (*net->event.cbf)(HTChannel_socket(host->channel), net->event.param, HTEvent_RESET);		    HTList_appendObject(host->pending, net);		}		HTChannel_setSemaphore(host->channel, 0);		HTHost_clearChannel(host, HT_INTERRUPTED);	    }	}	/*	**  If we know that this host is bad then we don't allow anything than	**  single mode. We can't recover connections for the rest of our life	*/	if (mode == HT_TP_PIPELINE && host->recovered > MAX_HOST_RECOVER) {	    HTTRACE(PROT_TRACE, "Host info... %p is bad for pipelining so we won't do it!!!\n" _ 			host);	} else {	    host->mode = mode;	    HTTRACE(PROT_TRACE, "Host info... New mode is %d for host %p\n" _ host->mode _ host);	}    }    return NO;}/***	Check whether a host is idle meaning if it is ready for a new**	request which depends on the mode of the host. If the host is **	idle, i.e. ready for use then return YES else NO. If the host supports**	persistent connections then still only return idle if no requests are**	ongoing. */PUBLIC BOOL HTHost_isIdle (HTHost * host){    return (host && HTList_isEmpty(host->pipeline));}PRIVATE BOOL _roomInPipe (HTHost * host){    int count;    if (!host ||	(host->reqsPerConnection && host->reqsMade >= host->reqsPerConnection) ||	HTHost_closeNotification(host) || host->broken_pipe)	return NO;    count = HTList_count(host->pipeline);    switch (host->mode) {    case HT_TP_SINGLE:	return count <= 0;    case HT_TP_PIPELINE:	return (host->recovered < MAX_HOST_RECOVER) ?	    (count < MaxPipelinedRequests) : (count <= 0);    case HT_TP_INTERLEAVE:	return YES;    }    return NO;}/***	Add a net object to the host object. If the host**	is idle then add to active list (pipeline) else add**	it to the pending list**	Return HT_PENDING if we must pend, HT_OK, or HT_ERROR*/PUBLIC int HTHost_addNet (HTHost * host, HTNet * net){    if (host && net) {	int status = HT_OK;	BOOL doit = (host->doit==net);	/*	**  If we don't have a socket already then check to see if we can get	**  one. Otherwise we put the host object into our pending queue.	*/	if (!host->channel && HTNet_availableSockets() <= 0) {	    /* Create list for pending Host objects */	    if (!PendHost) PendHost = HTList_new();	    /* Add the host object ad pending if not already */	    if (HTList_indexOf(PendHost, host) < 0) HTList_addObject(PendHost, host);	    /* 	    ** Add the Net object to the Host object. If it is the current Net	    ** obejct holding the lock then add it to the beginning of the list.	    ** Otherwise add it to the end	    */	    if (!host->pending) host->pending = HTList_new();	    if (host->lock == net)		HTList_appendObject(host->pending, net);	    else		HTList_addObject(host->pending, net); 	    HTTRACE(CORE_TRACE, "Host info... Added Net %p (request %p) as pending on pending Host %p, %d requests made, %d requests in pipe, %d pending\n" _ 			net _ net->request _ host _ host->reqsMade _ 			HTList_count(host->pipeline) _ HTList_count(host->pending));	    return HT_PENDING;	}#if 0	/*	** First check whether the net object is already on either queue.	** Do NOT add extra copies of the HTNet object to	** the pipeline or pending list (if it's already on the list).	*/	if (HTList_indexOf(host->pipeline, net) >= 0) {	    HTTRACE(CORE_TRACE, "Host info... The Net %p (request %p) is already in pipe,"			" %d requests made, %d requests in pipe, %d pending\n" _ 			net _ net->request _ host->reqsMade _ 			HTList_count(host->pipeline) _ 			HTList_count(host->pending));	    HTDEBUGBREAK("Net object %p registered multiple times in pipeline\n" _ 			 net);	    return HT_OK;	}	if (HTList_indexOf(host->pending,  net) >= 0) {	    HTTRACE(CORE_TRACE, "Host info... The Net %p (request %p) already pending,"			" %d requests made, %d requests in pipe, %d pending\n" _ 			net _ net->request _ host->reqsMade _ 			HTList_count(host->pipeline) _ 			HTList_count(host->pending));	    HTDEBUGBREAK("Net object %p registered multiple times in pending queue\n" _ 			 net);	    return HT_PENDING;	}#endif	/*	**  Add net object to either active or pending queue.	*/	if (_roomInPipe(host) && (HTList_isEmpty(host->pending) || doit)) {	    if (doit) host->doit = NULL;	    if (!host->pipeline) host->pipeline = HTList_new();	    HTList_addObject(host->pipeline, net);	    host->reqsMade++;            HTTRACE(CORE_TRACE, "Host info... Added Net %p (request %p) to pipe on Host %p, %d requests made, %d requests in pipe, %d pending\n" _ 			net _ net->request _ host _ host->reqsMade _ 			HTList_count(host->pipeline) _ HTList_count(host->pending));	    /*	    **  If we have been idle then make sure we delete the timer	    */	    if (host->timer) {		HTTimer_delete(host->timer);		host->timer = NULL;	    }                       /*JK: New CBF function	    ** Call any user-defined callback to say the request will            ** be processed.            */            HTHost_ActivateRequest (net);	} else {	    if (!host->pending) host->pending = HTList_new();	    HTList_addObject(host->pending, net);	    	    HTTRACE(CORE_TRACE, "Host info... Added Net %p (request %p) as pending on Host %p, %d requests made, %d requests in pipe, %d pending\n" _ 			net _ net->request _ 			host _ host->reqsMade _ 			HTList_count(host->pipeline) _ HTList_count(host->pending));	    status = HT_PENDING;	}	return status;    }    return HT_ERROR;}PRIVATE BOOL HTHost_free (HTHost * host, int status){    if (host->channel) {	/* Check if we should keep the socket open */        if (HTHost_isPersistent(host)) {	    int piped = HTList_count(host->pipeline);            if (HTHost_closeNotification(host)) {		HTTRACE(CORE_TRACE, "Host Object. got close notifiation on socket %d\n" _ 			    HTChannel_socket(host->channel));                		/*		**  If more than a single element (this one) in the pipe		**  then we have to recover gracefully		*/		if (piped > 1) {		    host->reqsPerConnection = host->reqsMade - piped;		    HTTRACE(CORE_TRACE, "%d requests made, %d in pipe, max %d requests pr connection\n" _ 				host->reqsMade _ piped _ host->reqsPerConnection);		    host->do_recover = YES;		    /* @@ JK: not clear yet if I need or not to set the channel to NULL. I think not */		    /* HTChannel_delete(host->channel, status);  */		    if (HTChannel_delete(host->channel, status)) {			HTTRACE(CORE_TRACE, "Host Event.. clearing channel on host %p (%s)\n" _ host _ host->hostname);			host->channel = NULL;		    }		} else {		    HTChannel_setSemaphore(host->channel, 0);		    HTHost_clearChannel(host, status);		}	    } else if (piped<=1 && host->reqsMade==host->reqsPerConnection) {                HTTRACE(CORE_TRACE, "Host Object. closing persistent socket %d\n" _ 			HTChannel_socket(host->channel));                                /*                 **  By lowering the semaphore we make sure that the channel                **  is gonna be deleted                */                HTChannel_setSemaphore(host->channel, 0);                HTHost_clearChannel(host, status);            } else {                HTTRACE(CORE_TRACE, "Host Object. keeping persistent socket %d\n" _ 			HTChannel_socket(host->channel));                if (HTChannel_delete(host->channel, status)) {		    HTDEBUGBREAK("Host Event.. Channel unexpected deleted from host %p (%s)\n" _ host _ host->hostname);		    host->channel = NULL;                }                /*                **  If connection is idle then set a timer so that we close the                 **  connection if idle too long                */                if (piped<=1 && HTList_isEmpty(host->pending) && !host->timer) {                    host->timer = HTTimer_new(NULL, IdleTimeoutEvent,					      host, HTActiveTimeout, YES, NO);                    HTTRACE(PROT_TRACE, "Host........ Object %p going idle...\n" _ host);                }            }            return YES;        } else {            HTTRACE(CORE_TRACE, "Host Object. closing socket %d\n" _ HTChannel_socket(host->channel));	    HTChannel_setSemaphore(host->channel, 0);	    HTHost_clearChannel(host, status);        }    }    return NO;}PUBLIC BOOL HTHost_deleteNet (HTHost * host, HTNet * net, int status){    if (host && net) {        HTTRACE(CORE_TRACE, "Host info... Remove %p from pipe\n" _ net);	/* If the Net object is in the pipeline then also update the channel */	if (host->pipeline && HTList_indexOf(host->pipeline, net) >= 0) {	    HTHost_free(host, status);	    HTList_removeObjectAll(host->pipeline, net);	}	HTList_removeObjectAll(host->pending, net); /* just to make sure */	host->lock = HTList_firstObject(host->pending);	return YES;    }    return NO;}/***	Handle pending host objects.**	There are two ways we can end up with pending reqyests:**	 1) If we are out of sockets then register new host objects as pending.**	 2) If we are pending on a connection then register new net objects as**	    pending**	This set of functions handles pending host objects and can start new**	requests as resources get available*//***	Check this host object for any pending requests and return the next**	registered Net object.*/PUBLIC HTNet * HTHost_nextPendingNet (HTHost * host){    HTNet * net = NULL;    if (host && host->pending) {	/*JK 23/Sep/96 Bug correction. Associated the following lines to the	**above if. There was a missing pair of brackets. 	*/	if ((net = (HTNet *) HTList_removeFirstObject(host->pending)) != NULL) {	    HTTRACE(CORE_TRACE, "Host info... Popping %p from pending net queue on host %p\n" _ 			net _ host);#if 0	    {		HTRequest * request = HTNet_request(net);		char * uri = HTAnchor_address((HTAnchor *) HTRequest_anchor(request));		fprintf(stderr, "Popping '%s'\n", uri);	    }#endif	    host->doit = net;	}    }    return net;}/***	Return the current list of pending host objects waiting for a socket*/PUBLIC HTHost * HTHost_nextPendingHost (void){    HTHost * host = NULL;    if (PendHost) {	if ((host = (HTHost *) HTList_removeFirstObject(PendHost)) != NULL)	    HTTRACE(PROT_TRACE, "Host info... Popping %p from pending host queue\n" _ 			host);    }    return host;}/***	Start the next pending request if any. First we look for pending**	requests for the same host and then we check for any other pending**	hosts*/PUBLIC BOOL HTHost_launchPending (HTHost * host){    HTNet * net = NULL;    if (!host) {	HTTRACE(PROT_TRACE, "Host info... Bad arguments\n");	return NO;    }    /*    **  In pipeline we can only have one doing writing at a time.    **  We therefore check that there are no other Net object    **  registered for write    */    if (host->mode == HT_TP_PIPELINE) {	net = (HTNet *) HTList_lastObject(host->pipeline);	if (net && net->registeredFor == HTEvent_WRITE)	    return NO;    }    /*    **  Check the current Host object for pending Net objects    */    if (_roomInPipe(host) && DoPendingReqLaunch &&	   (net = HTHost_nextPendingNet(host))) {	HTHost_ActivateRequest(net);	HTTRACE(CORE_TRACE, "Launch pending net object %p with %d reqs in pipe (%d reqs made)\n" _ 		    net _ HTList_count(host->pipeline) _ host->reqsMade);	return HTNet_execute(net, HTEvent_WRITE);    }    /*    **  Check for other pending Host objects    */    if (DoPendingReqLaunch && HTNet_availableSockets() > 0) {	HTHost * pending = HTHost_nextPendingHost();	if (pending && (net = HTHost_nextPendingNet(pending))) {	    if (!pending->pipeline) pending->pipeline = HTList_new();	    HTList_addObject(pending->pipeline, net);	    host->reqsMade++;	    HTTRACE(CORE_TRACE, "Launch pending host object %p, net %p with %d reqs in pipe (%d reqs made)\n" _ 			pending _ net _ HTList_count(pending->pipeline) _ pending->reqsMade);	    HTHost_ActivateRequest(net);	    return HTNet_execute(net, HTEvent_WRITE);	}    }    return YES;}PUBLIC HTNet * HTHost_firstNet (HTHost * host){    return (HTNet *) HTList_firstObject(host->pipeline);}PUBLIC int HTHost_numberOfOutstandingNetObjects (HTHost * host){    return host ? HTList_count(host->pipeline) : -1;}PUBLIC int HTHost_numberOfPendingNetObjects (HTHost * host){    return host ? HTList_count(host->pending) : -1;}/***	The host event manager keeps track of the state of it's client engines**	(typically HTTPEvent), accepting multiple blocks on read or write from**	multiple pipelined engines. It then registers its own engine **	(HostEvent) with the event manager.*/PUBLIC int HTHost_connect (HTHost * host, HTNet * net, char * url){    HTRequest * request = HTNet_request(net);    int status = HT_OK;    if (!host) {	HTProtocol * protocol = HTNet_protocol(net);	if ((host = HTHost_newWParse(request, url, HTProtocol_id(protocol))) == NULL)	    return HT_ERROR;	/*	** If not already locked and without a channel	** then lock the darn thing with the first Net object	** pending.	*/	if (!host->lock && !host->channel) {	    HTNet * next_pending = NULL;	    host->forceWriteFlush = YES;	    host->lock = (next_pending = HTList_firstObject(host->pending)) ?		next_pending : net;	    HTTRACE(CORE_TRACE, "Host connect Grabbing lock on Host %p with %p\n" _ host _ host->lock);	}	HTNet_setHost(net, host);    }    if (!host->lock || (host->lock && host->lock == net)) {	status = HTDoConnect(net);	if (status == HT_PENDING)	    return HT_WOULD_BLOCK;	else if (status == HT_WOULD_BLOCK) {	    host->lock = net;	    return status;	} else {	    /*	    **  See if there is already a new pending request that should	    **  take over the current lock	    */	    HTNet * next_pending = NULL;	    if ((next_pending = HTList_firstObject(host->pending))) {		HTTRACE(CORE_TRACE, "Host connect Changing lock on Host %p to %p\n" _ 			host _ next_pending);		host->lock = next_pending;	    	    } else {		HTTRACE(CORE_TRACE, "Host connect Unlocking Host %p\n" _ host);		host->lock = NULL;	    	    }	    return status;	}    } else {	HTTRACE(CORE_TRACE, "Host connect Host %p already locked with %p\n" _ host _ host->lock);	if ((status = HTHost_addNet(host, net)) == HT_PENDING) {	    return HT_PENDING;	}    }    return HT_ERROR; /* @@@ - some more deletion and stuff here? */}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一级二级三级| 欧美精品1区2区3区| 亚洲妇女屁股眼交7| 久久综合久久99| 欧美日本国产视频| 99久久精品国产一区二区三区| 秋霞国产午夜精品免费视频 | 欧美成人三级电影在线| 成人激情午夜影院| 久久精品国产秦先生| 亚洲一区二区三区四区在线| 欧美国产激情二区三区| 日韩美女主播在线视频一区二区三区 | 日韩久久免费av| 欧洲精品一区二区| 日韩视频免费直播| 91丨九色丨国产丨porny| 国产一区二区毛片| 捆绑调教美女网站视频一区| 亚洲午夜久久久| 亚洲精品自拍动漫在线| 日本一区二区三区免费乱视频| 日韩亚洲欧美高清| 777久久久精品| 欧美日韩亚洲综合一区二区三区| 91在线精品秘密一区二区| 国产成人免费视频网站高清观看视频| 日韩精品电影在线观看| 一个色综合网站| 亚洲视频在线观看一区| 中文字幕一区二区三区不卡| 国产免费成人在线视频| 久久精品一区蜜桃臀影院| 欧美大片拔萝卜| 日韩精品一区二区三区四区视频 | 91碰在线视频| 91小视频免费观看| 色中色一区二区| 91麻豆国产福利在线观看| 99久久精品一区| 91蜜桃网址入口| 91蝌蚪porny九色| 日本国产一区二区| 欧美色手机在线观看| 欧美专区亚洲专区| 欧美日韩高清影院| 日韩欧美在线网站| 欧美电影免费提供在线观看| 久久亚洲春色中文字幕久久久| 久久综合色鬼综合色| 国产日韩欧美综合在线| 国产精品免费网站在线观看| 国产精品第13页| 一区二区三区在线免费观看| 亚洲国产精品久久久久婷婷884 | 一区二区国产视频| 五月综合激情日本mⅴ| 美女视频黄a大片欧美| 国产伦理精品不卡| 99久久精品国产麻豆演员表| 91搞黄在线观看| 欧美丰满高潮xxxx喷水动漫| 欧美成人一区二区三区在线观看| 26uuu成人网一区二区三区| 国产欧美日韩精品a在线观看| 免费一级片91| 欧美高清视频在线高清观看mv色露露十八| 欧洲在线/亚洲| 欧美一级理论片| 亚洲国产岛国毛片在线| 亚洲综合视频网| 蜜桃av一区二区在线观看| 国产成人免费高清| 在线精品视频一区二区三四| 亚洲欧美色一区| 一区二区三区产品免费精品久久75| 亚洲成人动漫一区| 国产一区二区免费看| 色成人在线视频| 欧美一二三区在线观看| 日韩一区中文字幕| 蜜桃av一区二区| 99re热这里只有精品视频| 91麻豆精品国产91久久久资源速度| 精品国产免费一区二区三区四区| 中文字幕五月欧美| 免费一级欧美片在线观看| 国产a区久久久| 欧美一区二区三区视频在线 | 蜜臂av日日欢夜夜爽一区| 成人午夜看片网址| 4438x亚洲最大成人网| 中文一区二区完整视频在线观看| 亚洲3atv精品一区二区三区| 国产精品亚洲综合一区在线观看| 欧美日韩在线一区二区| 欧美激情在线一区二区三区| 日日骚欧美日韩| 97se狠狠狠综合亚洲狠狠| 精品久久久久久亚洲综合网| 夜夜嗨av一区二区三区网页 | 日韩美女视频在线| 亚洲制服丝袜在线| 成人三级伦理片| 日韩视频免费直播| 亚洲综合免费观看高清完整版 | 国产风韵犹存在线视精品| 8x8x8国产精品| 亚洲日穴在线视频| 国产精品一区一区| 日韩一级片在线播放| 亚洲成人在线免费| 一道本成人在线| 欧美韩国日本综合| 老司机免费视频一区二区| 欧美日韩国产另类不卡| 日韩码欧中文字| 成人免费毛片片v| 欧美精品一区二区高清在线观看| 亚洲成精国产精品女| 91精品福利在线| 亚洲欧美日韩电影| 91色porny| 国产精品久久久99| 成人高清免费观看| 国产精品人妖ts系列视频| 国产精品99久久久久久似苏梦涵| 欧美成va人片在线观看| 免费成人av在线| 日韩一级片在线播放| 久久国产尿小便嘘嘘尿| 日韩视频一区二区| 久久99精品久久久久| 欧美videos大乳护士334| 久久99久久精品| 精品成人免费观看| 国产麻豆精品久久一二三| 久久久久99精品一区| 国产成人精品三级麻豆| 久久精品一二三| 不卡大黄网站免费看| 久久久一区二区| 久久夜色精品一区| 99久久综合国产精品| 久久久久久久久久久久久夜| 国产盗摄一区二区| 97精品久久久午夜一区二区三区 | 国产成人精品亚洲777人妖 | 日韩制服丝袜av| 欧美色视频在线| 亚洲国产精品久久人人爱蜜臀| 国产色婷婷亚洲99精品小说| 国产精品电影一区二区| 在线综合视频播放| 99久久伊人网影院| 国内外精品视频| 一区二区三区精品久久久| www久久久久| 欧美精品xxxxbbbb| 成人激情小说乱人伦| 九一久久久久久| 免费在线观看精品| aaa欧美日韩| 国产精品蜜臀av| 精品一二三四区| 欧美一区二区在线不卡| 亚洲欧洲性图库| 国产精品12区| 久久久久97国产精华液好用吗| 天天av天天翘天天综合网| 波多野结衣亚洲| 国产日本亚洲高清| 国产成人午夜电影网| 久久日韩粉嫩一区二区三区 | 国产福利91精品一区| 精品国产一区二区精华| 欧美aaa在线| 日韩欧美在线影院| 狠狠色伊人亚洲综合成人| 欧美一区二区三区四区五区| 国产精品原创巨作av| 日韩一区二区免费在线观看| 亚洲综合在线视频| 色婷婷av一区| 日精品一区二区三区| 国产成人av一区二区三区在线 | 色拍拍在线精品视频8848| 欧美mv日韩mv国产网站| 五月激情六月综合| 日本精品免费观看高清观看| 国产精品色在线观看| 成人sese在线| 欧美大片一区二区| 亚洲免费观看高清在线观看| 亚洲成人高清在线| 蓝色福利精品导航| 91免费国产视频网站| 久久综合资源网| 亚洲自拍都市欧美小说| 国产91精品露脸国语对白|