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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? htchannl.c

?? firtext搜索引擎源碼
?? C
字號(hào):
/***	CONTAINS STREAMS FOR READING AND WRITING TO AND FROM A TRANSPORT****	(c) COPYRIGHT MIT 1995.**	Please first read the full copyright statement in the file COPYRIGH.**	@(#) $Id: HTChannl.c,v 2.26 2000/06/23 14:27:34 kahan Exp $****** HISTORY:**	April 96  HFN	Written*//* Library Include files */#include "wwwsys.h"#include "WWWUtil.h"#include "HTAlert.h"#include "HTHost.h"#include "HTError.h"#ifdef HT_MUX#include "WWWMux.h"#endif#include "HTChannl.h"					 /* Implemented here */#define HASH(s)		((s) % (HT_M_HASH_SIZE))struct _HTInputStream {    const HTInputStreamClass *	isa;    HTChannel *			channel;};struct _HTOutputStream {    const HTOutputStreamClass *	isa;    HTChannel *			channel;};struct _HTChannel {    /* what media do we talk to? */    SOCKET		sockfd;					   /* Socket */    FILE *		fp;				  /* File descriptor */    /* what streams handle the IO */    HTInputStream *	input;				     /* Input stream */    HTOutputStream *	output;				    /* Output stream */    /* proxy streams to dereference the above streams */    HTInputStream	channelIStream;    HTOutputStream	channelOStream;    BOOL		active;			/* Active or passive channel */    int			semaphore;			   /* On channel use */    HTHost *		host;			       /* Zombie connections */};PRIVATE HTList	** channels = NULL;			 /* List of channels *//* ------------------------------------------------------------------------- *//***	Skinny stream objects to pass the IO requests to the channels current IO streams.**	This was needed because the channel's IO streams could go away after the IO streams**	were set up for multiple requests.*/PRIVATE int ChannelIStream_flush (HTInputStream * me){return me->channel->input ? (*me->channel->input->isa->flush)(me->channel->input) : HT_ERROR;}PRIVATE int ChannelIStream_free (HTInputStream * me){return me->channel->input ? (*me->channel->input->isa->_free)(me->channel->input) : HT_ERROR;}PRIVATE int ChannelIStream_abort (HTInputStream * me, HTList * e){return me->channel->input ? (*me->channel->input->isa->abort)(me->channel->input, e) : HT_ERROR;}PRIVATE int ChannelIStream_read (HTInputStream * me){return me->channel->input ? (*me->channel->input->isa->read)(me->channel->input) : HT_ERROR;}PRIVATE int ChannelIStream_close (HTInputStream * me){return me->channel->input ? (*me->channel->input->isa->close)(me->channel->input) : HT_ERROR;}PUBLIC int ChannelIStream_consumed (HTInputStream * me, size_t bytes){return me->channel->input ? (*me->channel->input->isa->consumed)(me->channel->input, bytes) : HT_ERROR;}PRIVATE const HTInputStreamClass ChannelIStreamIsa ={    "ChannelInput",    ChannelIStream_flush,    ChannelIStream_free,    ChannelIStream_abort,    ChannelIStream_read,    ChannelIStream_close,    ChannelIStream_consumed}; PRIVATE int ChannelOStream_flush (HTOutputStream * me){return me->channel->output ? (*me->channel->output->isa->flush)(me->channel->output) : HT_ERROR;}PRIVATE int ChannelOStream_free (HTOutputStream * me){return me->channel->output ? (*me->channel->output->isa->_free)(me->channel->output) : HT_ERROR;}PRIVATE int ChannelOStream_abort (HTOutputStream * me, HTList * e){return me->channel->output ? (*me->channel->output->isa->abort)(me->channel->output, e) : HT_ERROR;}PRIVATE int ChannelOStream_put_character (HTOutputStream * me, char c){return me->channel->output ? (*me->channel->output->isa->put_character)(me->channel->output, c) : HT_ERROR;}PRIVATE int ChannelOStream_put_string (HTOutputStream * me, const char * s){return me->channel->output ? (*me->channel->output->isa->put_string)(me->channel->output, s) : HT_ERROR;}PRIVATE int ChannelOStream_put_block (HTOutputStream * me, const char * buf, int len){return me->channel->output ? (*me->channel->output->isa->put_block)(me->channel->output, buf, len) : HT_ERROR;}PRIVATE int ChannelOStream_close (HTOutputStream * me){return me->channel->output ? (*me->channel->output->isa->close)(me->channel->output) : HT_ERROR;}PRIVATE const HTOutputStreamClass ChannelOStreamIsa ={    "ChannelOutput",    ChannelOStream_flush,    ChannelOStream_free,    ChannelOStream_abort,    ChannelOStream_put_character,    ChannelOStream_put_string,    ChannelOStream_put_block,    ChannelOStream_close,}; /* ------------------------------------------------------------------------- */PRIVATE void free_channel (HTChannel * ch){    if (ch) {	/* Close the input and output stream */	if (ch->input) {	    (*ch->input->isa->close)(ch->input);	    ch->input = NULL;	}	if (ch->output) {	    (*ch->output->isa->close)(ch->output);	    ch->output = NULL;	}	/* Close the socket */	if (ch->sockfd != INVSOC) {	    NETCLOSE(ch->sockfd);   	    HTNet_decreaseSocket();	    HTTRACE(PROT_TRACE, "Channel..... Deleted %p, socket %d\n" _ ch _ ch->sockfd);	    ch->sockfd = INVSOC;	}	/* Close the file */	if (ch->fp) {	    fclose(ch->fp);	    HTTRACE(PROT_TRACE, "Channel..... Deleted %p, file %p\n" _ ch _ ch->fp);	    ch->fp = NULL;	}	HT_FREE(ch);    }}/***	A channel is uniquely identified by a socket.**	Note that we don't create the input and output stream - they are **	created later.****	We only keep a hash on sockfd's as we don't have to look for channels**	for ANSI file descriptors.*/PUBLIC HTChannel * HTChannel_new (SOCKET sockfd, FILE * fp, BOOL active){    HTList * list = NULL;    HTChannel * ch = NULL;    int hash = sockfd < 0 ? 0 : HASH(sockfd);    HTTRACE(PROT_TRACE, "Channel..... Hash value is %d\n" _ hash);    if (!channels) {	if (!(channels = (HTList **) HT_CALLOC(HT_M_HASH_SIZE,sizeof(HTList*))))	    HT_OUTOFMEM("HTChannel_new");    }    if (!channels[hash]) channels[hash] = HTList_new();    list = channels[hash];    if ((ch = (HTChannel *) HT_CALLOC(1, sizeof(HTChannel))) == NULL)	HT_OUTOFMEM("HTChannel_new");	        ch->sockfd = sockfd;    ch->fp = fp;    ch->active = active;    ch->semaphore = 1;    ch->channelIStream.isa = &ChannelIStreamIsa;    ch->channelOStream.isa = &ChannelOStreamIsa;    ch->channelIStream.channel = ch;    ch->channelOStream.channel = ch;    HTList_addObject(list, (void *) ch);#ifdef HT_MUX	    /*	    **  Create a MUX channel and do a connect on this channel with a	    **  new session.	    */	    {		HTProtocol * protocol = HTNet_protocol(net);		HTMuxChannel * muxch = HTMuxChannel_new(me);		net->session = HTMuxSession_connect(muxch, net, HTProtocol_id(protocol));	    }#endif /* HT_MUX */    HTTRACE(PROT_TRACE, "Channel..... Added %p to list %p\n" _ ch _ list);    return ch;}/***	Look for a channel object if we for some reason should have lost it**	Returns NULL if nothing found*/PUBLIC HTChannel * HTChannel_find (SOCKET sockfd){    if (channels && sockfd != INVSOC) {	int hash = HASH(sockfd);	HTList * list = channels[hash];	if (list) {	    HTChannel * ch = NULL;	    while ((ch = (HTChannel *) HTList_nextObject(list)))		if (ch->sockfd == sockfd) return ch;	}    }    return NULL;}/***	When deleting a channel we first look at if there are no more requests**	using the channel (the semaphore is <= 0). Then, if the socket supports**	persistent connections then we register the channel in the Host cache**	and wait until the other end closes it or we get a time out on our side*/PUBLIC BOOL HTChannel_delete (HTChannel * channel, int status){    if (channel) {	HTTRACE(PROT_TRACE, "Channel..... Delete %p with semaphore %d, status %d\n" _ 		channel _ channel->semaphore _ status);	/*	**  We call the free methods on both the input stream and the output	**  stream so that we can free up the stream pipes. However, note that	**  this doesn't mean that we close the input stream and output stream	**  them selves - only the generic streams	*/	HTChannel_deleteInput(channel, status);	HTChannel_deleteOutput(channel, status);	/*	**  Check whether this channel is used by other objects or we can	**  delete it and free memory.	*/	if (channel->semaphore <= 0 && channels && (	    channel->sockfd != INVSOC || channel->fp != NULL)) {            int hash = HASH(channel->sockfd);	    HTList * list = channels[hash];	    if (list) {		HTList_removeObject(list, (void *) channel);		free_channel(channel);		return YES;	    }	} else	    HTChannel_downSemaphore(channel);    }    return NO;}/*	HTChannel_deleteAll**	-------------------**	Destroys all channels. This is called by HTLibTerminate(0*/PUBLIC BOOL HTChannel_deleteAll (void){    if (channels) {	HTList * cur;	int cnt;	for (cnt=0; cnt<HT_M_HASH_SIZE; cnt++) {	    if ((cur = channels[cnt])) { 		HTChannel * pres;		while ((pres = (HTChannel *) HTList_nextObject(cur)) != NULL)		    free_channel(pres);	    }	    HTList_delete(channels[cnt]);	}	HT_FREE(channels);    }    return YES;}/*      HTChannel_safeDeleteAll**      -------------------**      Destroys all channels. This is called by HTLibTerminate(0*/ PUBLIC BOOL HTChannel_safeDeleteAll (void){    if (channels) {        HTList * cur;        int cnt;        for (cnt=0; cnt<HT_M_HASH_SIZE; cnt++) {          if ((cur = channels[cnt])) {            HTChannel * pres;            while ((pres = (HTChannel *) HTList_nextObject(cur)) != NULL) {              HTChannel_delete (pres, HT_TIMEOUT);              cur = channels[cnt];            }	    HTList_delete (channels[cnt]);	    channels[cnt] = NULL;          }        }        return YES;    }    return NO;}/***	Return the socket associated with this channel*/PUBLIC SOCKET HTChannel_socket (HTChannel * channel){    return channel ? channel->sockfd : INVSOC;}PUBLIC BOOL HTChannel_setSocket (HTChannel * channel, SOCKET sockfd){    if (channel) {		/*	** As we use the socket number as the hash entry then we have to	** update the hash table as well.	*/	int old_hash = HASH(channel->sockfd);	int new_hash = sockfd < 0 ? 0 : HASH(sockfd);	HTList * list = channels[old_hash];	if (list) HTList_removeObject(list, channel);	if (!channels[new_hash]) channels[new_hash] = HTList_new();	list = channels[new_hash];	HTList_addObject(list, channel);	channel->sockfd = sockfd;	return YES;    }    return NO;}/***	Return the file descriptor associated with this channel*/PUBLIC FILE * HTChannel_file (HTChannel * channel){    return channel ? channel->fp : NULL;}PUBLIC BOOL HTChannel_setFile (HTChannel * channel, FILE * fp){    if (channel) {	channel->fp = fp;	return YES;    }    return NO;}/***	We keep the associated Host object in case we have a**	sleeping connection. */PUBLIC BOOL HTChannel_setHost (HTChannel * ch, HTHost * host){    if (ch) {	ch->host = host;	return YES;    }    return NO;}PUBLIC HTHost * HTChannel_host (HTChannel * ch){    return (ch ? ch->host : NULL);}/***	Increase the semaphore for this channel*/PUBLIC void HTChannel_upSemaphore (HTChannel * channel){    if (channel) {	channel->semaphore++;	HTTRACE(PROT_TRACE, "Channel..... Semaphore increased to %d for channel %p\n" _ 		    channel->semaphore _ channel);#ifdef HT_MUX		HTMuxChannel * muxch = HTMuxChannel_find(me);		HTProtocol * protocol = HTNet_protocol(net);		net->session = HTMuxSession_connect(muxch, net, HTProtocol_id(protocol));#endif /* HT_MUX */    }}/***	Decrease the semaphore for this channel*/PUBLIC void HTChannel_downSemaphore (HTChannel * channel){    if (channel) {	channel->semaphore--;	if (channel->semaphore <= 0) channel->semaphore = 0;	HTTRACE(PROT_TRACE, "Channel..... Semaphore decreased to %d for channel %p\n" _ 		    channel->semaphore _ channel);    }}/***	Explicitly set the semaphore for this channel*/PUBLIC void HTChannel_setSemaphore (HTChannel * channel, int semaphore){    if (channel) {	channel->semaphore = semaphore;	if (channel->semaphore <= 0) channel->semaphore = 0;	HTTRACE(PROT_TRACE, "Channel..... Semaphore set to %d for channel %p\n" _ 		    channel->semaphore _ channel);    }}/***	Create the input stream and bind it to the channel**	Please read the description in the HTIOStream module on the parameters*/PUBLIC BOOL HTChannel_setInput (HTChannel * ch, HTInputStream * input){    if (ch) {	ch->input = input;	return YES;    }    return NO;}PUBLIC HTInputStream * HTChannel_input (HTChannel * ch){    return ch ? ch->input : NULL;}PUBLIC BOOL HTChannel_deleteInput (HTChannel * channel, int status){	    if (channel && channel->input && status != HT_IGNORE) {	HTTRACE(PROT_TRACE,		"Channel..... Delete input stream %p from channel %p\n" _ 		channel->input _ channel);	if (status==HT_INTERRUPTED || status==HT_TIMEOUT)	    (*channel->input->isa->abort)(channel->input, NULL);	else	    (*channel->input->isa->_free)(channel->input);	return YES;    }    return NO;}/***	Create the output stream and bind it to the channel**	Please read the description in the HTIOStream module on the parameters*/PUBLIC BOOL HTChannel_setOutput (HTChannel * ch, HTOutputStream * output){    if (ch) {	ch->output = output;	return YES;    }    return NO;}PUBLIC HTOutputStream * HTChannel_output (HTChannel * ch){    return ch ? ch->output : NULL;}PUBLIC BOOL HTChannel_deleteOutput (HTChannel * channel, int status){	    if (channel && channel->output && status != HT_IGNORE) {	HTTRACE(PROT_TRACE,		"Channel..... Delete input stream %p from channel %p\n" _ 		channel->input _ channel);	if (status==HT_INTERRUPTED || status==HT_TIMEOUT)	    (*channel->output->isa->abort)(channel->output, NULL);	else	    (*channel->output->isa->_free)(channel->output);	return YES;    }    return NO;}PUBLIC HTInputStream * HTChannel_getChannelIStream (HTChannel * ch){    if (ch)	return &ch->channelIStream;    return NULL;}PUBLIC HTOutputStream * HTChannel_getChannelOStream (HTChannel * ch){    if (ch)	return &ch->channelOStream;    return NULL;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩欧美一区二区三区综合| 亚洲综合精品自拍| 精品久久久久久久久久久久久久久| 在线亚洲+欧美+日本专区| 99r精品视频| 成人97人人超碰人人99| 成人三级在线视频| 成人精品视频一区二区三区| 国产91高潮流白浆在线麻豆 | 欧美激情艳妇裸体舞| 精品对白一区国产伦| 日韩欧美国产wwwww| 日韩精品一区在线观看| 精品国精品国产| 精品国产伦理网| 国产欧美综合在线| 国产精品成人免费在线| 亚洲视频一区在线观看| 一区二区三区四区蜜桃| 亚洲午夜影视影院在线观看| 亚洲成人久久影院| 美腿丝袜一区二区三区| 国产一区二区三区免费播放| 国产很黄免费观看久久| eeuss鲁片一区二区三区在线观看| 成人av在线资源网| 色婷婷亚洲婷婷| 欧美日韩的一区二区| 精品国产成人系列| 国产精品网友自拍| 亚洲一区二区三区在线播放| 五月综合激情网| 国产在线精品国自产拍免费| 岛国精品一区二区| 91国产福利在线| 欧美一区日韩一区| 久久精品网站免费观看| 自拍av一区二区三区| 亚洲大片免费看| 国内精品在线播放| 99精品在线观看视频| 制服丝袜中文字幕亚洲| 国产欧美日韩卡一| 亚洲第一在线综合网站| 久久99热这里只有精品| a在线播放不卡| 7777精品伊人久久久大香线蕉最新版 | 成人免费高清在线| 欧美日韩一本到| 久久色成人在线| 伊人色综合久久天天人手人婷| 美女久久久精品| 91在线播放网址| 日韩美一区二区三区| 综合在线观看色| 六月婷婷色综合| 日本道免费精品一区二区三区| 精品久久久久香蕉网| 亚洲欧美乱综合| 狠狠久久亚洲欧美| 欧美亚洲日本国产| 国产日韩一级二级三级| 性做久久久久久| av色综合久久天堂av综合| 91精品国产麻豆| 亚洲欧美日韩国产综合| 国产在线精品一区二区不卡了 | 久久新电视剧免费观看| 一区二区三区免费| 国产成人综合网| 91精品国产91久久久久久一区二区| 国产精品美女久久久久久2018| 蜜臀国产一区二区三区在线播放| 91视频观看视频| 久久精品免费在线观看| 日韩成人一级片| 日本精品视频一区二区| 国产亚洲精品aa| 日本亚洲一区二区| 日本久久精品电影| 中文字幕一区在线| 国产麻豆9l精品三级站| 欧美一个色资源| 亚洲丰满少妇videoshd| 色婷婷久久久综合中文字幕| 欧美国产一区在线| 国产一区二区电影| 欧美成人综合网站| 日本怡春院一区二区| 欧美在线观看你懂的| 亚洲精品自拍动漫在线| www.亚洲激情.com| 日本一区二区成人在线| 韩国精品一区二区| 精品99一区二区三区| 青青草国产成人av片免费| 欧美精品免费视频| 首页亚洲欧美制服丝腿| 欧美三级资源在线| 亚洲一区欧美一区| 在线日韩一区二区| 一区二区国产盗摄色噜噜| 色综合中文字幕| ㊣最新国产の精品bt伙计久久| youjizz久久| 国产精品国产精品国产专区不片| 福利电影一区二区三区| 中文字幕欧美日本乱码一线二线| 国产精品影视天天线| 久久奇米777| 国产一区在线看| 国产亚洲欧美色| 成人涩涩免费视频| 亚洲人妖av一区二区| 99精品视频在线播放观看| 亚洲视频一区二区免费在线观看| 91丨porny丨中文| 一级精品视频在线观看宜春院 | 中文字幕在线观看一区二区| 99在线精品视频| 亚洲综合色自拍一区| 欧美日韩日日摸| 日本中文字幕不卡| 精品理论电影在线观看| 国产麻豆精品视频| 亚洲欧美在线视频观看| 在线免费av一区| 日韩电影在线免费| 2020日本不卡一区二区视频| 国产一区二区三区在线观看免费| 国产亚洲一二三区| 色综合天天综合色综合av | 一级中文字幕一区二区| 在线成人av影院| 国产精品资源网站| 亚洲精品亚洲人成人网在线播放| 欧美日本国产一区| 国产乱码精品1区2区3区| 国产精品国产三级国产普通话三级 | 亚洲人成网站精品片在线观看| 精品视频在线视频| 精品一区二区三区不卡 | 另类中文字幕网| 色狠狠av一区二区三区| 一区二区三区四区高清精品免费观看| 欧洲精品视频在线观看| 奇米一区二区三区| 国产亚洲一二三区| 欧美午夜精品久久久久久孕妇| 蜜臀91精品一区二区三区| 国产女主播视频一区二区| 色哟哟在线观看一区二区三区| 人人爽香蕉精品| 中文字幕av不卡| 欧美日产国产精品| 国产a区久久久| 亚洲国产日韩综合久久精品| 久久影院电视剧免费观看| 91免费看视频| 精品一区二区综合| 一区二区三区精品视频| 26uuu色噜噜精品一区二区| 色呦呦国产精品| 国产精品综合在线视频| 亚洲一区二区在线免费观看视频 | 久久精品一区二区| 欧美色男人天堂| 成人午夜视频在线| 日韩黄色片在线观看| 日韩一区在线播放| 久久午夜老司机| 欧美一区欧美二区| 91久久免费观看| 国产99精品国产| 日本视频中文字幕一区二区三区| 中文字幕一区日韩精品欧美| 欧美成va人片在线观看| 欧美午夜在线一二页| 不卡高清视频专区| 狠狠狠色丁香婷婷综合激情| 亚洲成av人片在线观看无码| 国产精品久久久久久户外露出| 精品国产第一区二区三区观看体验| 欧美日韩精品一区二区三区蜜桃| 99久久精品国产精品久久| 国模一区二区三区白浆| 亚洲va天堂va国产va久| 一区二区欧美视频| 1区2区3区欧美| 欧美国产精品中文字幕| 久久色在线观看| 亚洲精品一线二线三线无人区| 欧美日韩国产不卡| 欧美网站大全在线观看| 色婷婷激情综合| 91亚洲精品一区二区乱码| 成人av免费在线| 懂色av一区二区三区免费观看| 国产综合久久久久久鬼色| 麻豆国产欧美一区二区三区|