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

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

?? httcp.c

?? www工具包. 這是W3C官方支持的www支撐庫. 其中提供通用目的的客戶端的WebAPI: complete HTTP/1.1 (with caching, pipelining, PUT, POS
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*									HTTCP.c**	TCP SPECIFIC CODE****	(c) COPYRIGHT MIT 1995.**	Please first read the full copyright statement in the file COPYRIGH.**	@(#) $Id: HTTCP.c,v 2.119 2000/08/02 10:48:12 kahan Exp $****	This code is in common between client and server sides.****	16 Jan 92  TBL	Fix strtol() undefined on CMU Mach.**	25 Jun 92  JFG  Added DECNET option through TCP socket emulation.**	13 Sep 93  MD   Added correct return of vmserrorno for HTInetStatus.**			Added decoding of vms error message for MULTINET.**	31 May 94  HF	Added cache on host id's; now use inet_ntoa() to**			HTInetString and some other fixes. Added HTDoConnect**			and HTDoAccept*//* Library include files */#include "wwwsys.h"#include "WWWUtil.h"#include "WWWCore.h"#include "HTReqMan.h"#include "HTNetMan.h"#include "HTTCP.h"					 /* Implemented here */#include "HTHstMan.h"/* VMS stuff */#ifdef VMS#ifndef MULTINET#define FD_SETSIZE 32#else /* Multinet */#define FD_SETSIZE 256#endif /* Multinet */#endif /* VMS *//* Macros and other defines *//* x ms penalty on a multi-homed host if IP-address is unreachable */#define TCP_DELAY		30000/* x ms penalty on a multi-homed host if IP-address is down for unknown reason */#define TCP_PENALTY		60000/* empirical study in socket call error codes   yovavm@contact.com : added handling for WSAEINVAL error code (Windows)   "When calling connect() in the second time, after the first call to    connect() returned WSAEWOULDBLOCK, an error of WSAEINVAL is returned.    It happens often on WinNT & Win95, and rarely on Win2K & Win98, where in    most cases the second call to connect() returns WSAEISCON (10056).   jose@w3.org : didn't add that test for Unix, as the connect() doc (Linux   and Solaris) says it's not needed. */#ifdef _WINSOCKAPI_					/* windows */#define NETCALL_ERROR(ret)	(ret == SOCKET_ERROR)#define NETCALL_DEADSOCKET(err)	(err == WSAEBADF)#define NETCALL_WOULDBLOCK(err)	(err == WSAEWOULDBLOCK)#define NETCALL_INVAL(err)      (err == WSAEINVAL)#else /* _WINSOCKAPI_ 					   unix    */#define NETCALL_ERROR(ret)	(ret < 0)#define NETCALL_DEADSOCKET(err)	(err == EBADF)#if defined(EAGAIN) && defined(EALREADY)#define NETCALL_WOULDBLOCK(err)	(err == EINPROGRESS || \				 err == EALREADY || \				 err == EAGAIN)#else /* (EAGAIN && EALREADY) */#ifdef EALREADY#define NETCALL_WOULDBLOCK(err)	(err == EINPROGRESS || err == EALREADY)#else /* EALREADY */#ifdef EAGAIN#define NETCALL_WOULDBLOCK(err)	(err == EINPROGRESS || err == EAGAIN)#else /* EAGAIN */#define NETCALL_WOULDBLOCK(err)	(err == EINPROGRESS)#endif /* !EAGAIN */#endif /* !EALREADY */#endif /* !(EAGAIN && EALREADY) */#endif /* !_WINSOCKAPI_ 				   done */#if defined(__svr4__) || defined (_WINSOCKAPI_)#define HT_HOSTUNREACHABLE(e)	((e)==ECONNREFUSED || (e)==ETIMEDOUT || \				 (e)==ENETUNREACH || (e)==EHOSTUNREACH || \				 (e)==EHOSTDOWN)#else#define HT_HOSTUNREACHABLE(e)	((e)==ECONNREFUSED || (e)==ETIMEDOUT || \				 (e)==ENETUNREACH || (e)==EHOSTUNREACH || \				 (e)==EHOSTDOWN || (e)==EINVAL)#endif/* ------------------------------------------------------------------------- *//*	       	      CONNECTION ESTABLISHMENT MANAGEMENT 		     *//* ------------------------------------------------------------------------- *//* _makeSocket - create a socket, if !preemptive, set FIONBIO** returns sockfd or INVSOC if error*/PRIVATE int _makeSocket (HTHost * host, HTRequest * request, int preemptive){    int status = 1;    SOCKET sockfd = INVSOC;#ifdef DECNET    if ((sockfd=socket(AF_DECnet, SOCK_STREAM, 0))==INVSOC)#else    if ((sockfd=socket(AF_INET, SOCK_STREAM,IPPROTO_TCP))==INVSOC)#endif    {	HTRequest_addSystemError(request, ERR_FATAL, socerrno, NO, "socket");	return INVSOC;    }    HTTRACE(PROT_TRACE, "Socket...... Created %d\n" _ sockfd);    /* Increase the number of sockets by one */    HTNet_increaseSocket();    /*    **  If we have compiled without Nagle's algorithm then try and turn    **  it off now    */#if defined(HT_NO_NAGLE) && defined(HAVE_SETSOCKOPT) && defined(TCP_NODELAY)    {	int disable = 1;	status = setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY,			    (char *) &disable, sizeof(int));	if (status == -1) {	    HTTRACE(PROT_TRACE, "Socket...... Could not disable Nagle's algorithm - error %d\n" _ 			sockfd);	} else {	    HTTRACE(PROT_TRACE, "Socket...... Turned off Nagle's algorithm\n");	}    }#endif    /* If non-blocking protocol then change socket status    ** I use fcntl() so that I can ask the status before I set it.    ** See W. Richard Stevens (Advan. Prog. in UNIX environment, p.364)    ** Be CAREFULL with the old `O_NDELAY' - it will not work as read()    ** returns 0 when blocking and NOT -1. FNDELAY is ONLY for BSD and    ** does NOT work on SVR4 systems. O_NONBLOCK is POSIX.    */    if (!preemptive) {#ifdef _WINSOCKAPI_	{		/* begin windows scope  */	    long levents = FD_READ | FD_WRITE | FD_ACCEPT | 			   FD_CONNECT | FD_CLOSE ;	    int rv = 0 ;	    u_long one = 1;	    status = ioctlsocket(sockfd, FIONBIO, &one) == 		     SOCKET_ERROR ? -1 : 0;	} /* end scope */#else /* _WINSOCKAPI_ */#if defined(VMS)	{	    int enable = 1;	    status = IOCTL(sockfd, FIONBIO, &enable);	}#else /* VMS */	if((status = fcntl(sockfd, F_GETFL, 0)) != -1) {#ifdef O_NONBLOCK	    status |= O_NONBLOCK;			    /* POSIX */#else /* O_NONBLOCK */#ifdef F_NDELAY		    status |= F_NDELAY;				      /* BSD */#endif /* F_NDELAY */#endif /* !O_NONBLOCK */		    status = fcntl(sockfd, F_SETFL, status);	}#endif /* !VMS */#endif /* !_WINSOCKAPI_ */	HTTRACE(PROT_TRACE, "Socket...... %slocking socket\n" _ status == -1 ? "B" : "Non-b");    } else	HTTRACE(PROT_TRACE, "Socket...... Blocking socket\n");    return sockfd;}/***  Associate the channel with the host and create an input and and output stream**  for this host/channel*/PRIVATE BOOL createChannelAndTransportStreams (HTHost * host, SOCKET sockfd, HTTransport * trans){    if (host && sockfd!=INVSOC && trans) {	HTHost_setChannel(host, HTChannel_new(sockfd, NULL, YES));	HTHost_getInput(host, trans, NULL, 0);	HTHost_getOutput(host, trans, NULL, 0);	return YES;    }    return NO;}/*								HTDoConnect()****	Note: Any port indication in URL, e.g., as `host:port' overwrites**	the default port value.****	returns		HT_ERROR	Error has occured or interrupted**			HT_OK		if connected**			HT_WOULD_BLOCK  if operation would have blocked*/PUBLIC int HTDoConnect (HTNet * net){    HTHost * host = HTNet_host(net);    HTRequest * request = HTNet_request(net);    char * hostname = HTHost_name(host);    int preemptive = net->preemptive;    int status = HT_OK;    /* Jump into the state machine */    while (1) {	switch (host->tcpstate) {	  case TCP_BEGIN:	  {	      /*	      ** Add the net object to the host object found above. If the	      ** host is idle then we can start the request right away,	      ** otherwise we must wait until it is free. 	      */	      if ((status = HTHost_addNet(host, net)) == HT_PENDING)		  HTTRACE(PROT_TRACE, "HTDoConnect. Pending...\n");	      /*	      ** If we are pending then return here, otherwise go to next state	      ** which is setting up a channel	      */	      host->tcpstate = TCP_CHANNEL;	      HTTRACE(PROT_TRACE, "HTHost %p going to state TCP_CHANNEL.\n" _ host);	      if (status == HT_PENDING) return HT_PENDING;	  }	  break;	case TCP_CHANNEL:	    /*	    **  The next state depends on whether we have a connection	    **  or not - if so then we can jump directly to connect() to	    **  test it - otherwise we must around DNS to get the name	    **  Resolved	    */	    if (HTHost_channel(host) == NULL) {		host->tcpstate = TCP_DNS;		HTTRACE(PROT_TRACE, "HTHost %p going to state TCP_DNS.\n" _ host);	    } else {		/*		**  There is now one more using the channel		*/		HTChannel_upSemaphore(host->channel);		/*		**  We are now all set and can jump to connected mode		*/		host->tcpstate = TCP_CONNECTED;		HTTRACE(PROT_TRACE, "HTHost %p going to state TCP_CONNECTED.\n" _ host);	    }	    hostname = HTHost_name(host);	    break;	case TCP_DNS:	    if ((status = HTParseInet(host, hostname, request)) < 0) {		HTTRACE(PROT_TRACE, "HTDoConnect. Can't locate `%s\'\n" _ hostname);		HTRequest_addError(request, ERR_FATAL, NO,				   HTERR_NO_REMOTE_HOST,				   (void *) hostname, strlen(hostname),				   "HTDoConnect");		host->tcpstate = TCP_DNS_ERROR;		HTTRACE(PROT_TRACE, "HTHost %p going to state TCP_ERROR.\n" _ host);		break;	    }	    if (!HTHost_retry(host) && status > 1)		/* If multiple homes */		HTHost_setRetry(host, status);	    host->tcpstate = TCP_NEED_SOCKET;	    HTTRACE(PROT_TRACE, "HTHost %p going to state TCP_NEED_SOCKET.\n" _ host);	    break;	case TCP_NEED_SOCKET:	{	    SOCKET sockfd;	    /* Create a new socket */	    if ((sockfd = _makeSocket(host, request, preemptive)) == INVSOC) {		host->tcpstate = TCP_ERROR;		break;	    }	    /* Create channnel and streams */	    createChannelAndTransportStreams (host, sockfd, net->transport);	    /* If multi-homed host then start timer on connection */	    if (HTHost_retry(host)) host->connecttime = HTGetTimeInMillis();	    /* Progress notification */	    {		HTAlertCallback *cbf = HTAlert_find(HT_PROG_CONNECT);		if (cbf) (*cbf)(request, HT_PROG_CONNECT, HT_MSG_NULL,				NULL, hostname, NULL);	    }	    host->tcpstate = TCP_NEED_CONNECT;	    HTTRACE(PROT_TRACE, "HTHost %p going to state TCP_NEED_CONNECT.\n" _ host);	    break;	}	case TCP_NEED_CONNECT:#ifdef _WINSOCKAPI_	    /* 2000/08/02 Jens Meggers (jens@meggers.com):            ** In HTDoConnect(), the connect command is done before the            ** WSAAsyncSelect() that is called when             ** HTHost_register(host, net, HTEvent_CONNECT); is executed.             ** Although that is in line with the WinSock2 and Microsoft             ** documentation, it does _not_ work all the time. I have done             ** extensive tests on Win2000 and Win 4.0 SP5. In very rare cases,            ** the connect is finished between the connect() command itself and             ** the WSAAsyncSelect(). In this unlikely case, WinSock does not             ** (always) send the FD_CONNECT message. As a result, when using             ** the Async mode, the event loop hangs because there is no             ** timeout procedure registered for FD_CONNECT.	    ** JK: what happens if status returns an error? Do we have to	    ** unregister the HTEvent_CONNECT event then?                                   */	    HTHost_register(host, net, HTEvent_CONNECT);#endif /* _WINSOCKAPI_ */	    status = connect(HTChannel_socket(host->channel), (struct sockaddr *) &host->sock_addr,			     sizeof(host->sock_addr));	    /*	     * According to the Sun man page for connect:	     *     EINPROGRESS         The socket is non-blocking and the  con-	     *                         nection cannot be completed immediately.	     *                         It is possible to select(2) for  comple-	     *                         tion  by  selecting the socket for writ-	     *                         ing.	     * According to the Motorola SVR4 man page for connect:	     *     EAGAIN              The socket is non-blocking and the  con-	     *                         nection cannot be completed immediately.	     *                         It is possible to select for  completion	     *                         by  selecting  the  socket  for writing.	     *                         However, this is only  possible  if  the	     *                         socket  STREAMS  module  is  the topmost	     *                         module on  the  protocol  stack  with  a	     *                         write  service  procedure.  This will be	     *                         the normal case.	     */	    if (NETCALL_ERROR(status))	    {		if (NETCALL_WOULDBLOCK(socerrno))		{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99国产精品成人| 国产精品一区二区x88av| 99视频超级精品| 奇米综合一区二区三区精品视频| 欧美一级片免费看| 国产不卡免费视频| 亚洲综合视频网| 久久亚洲综合av| 91成人免费在线视频| 狠狠狠色丁香婷婷综合激情 | 日韩免费视频一区| 91成人免费在线视频| 成人综合在线网站| 日韩激情在线观看| 亚洲欧美成人一区二区三区| 日韩欧美一级二级| 欧美日韩在线免费视频| 91在线观看污| 不卡av免费在线观看| 国产精品888| 亚洲午夜在线电影| 亚洲主播在线观看| 亚洲免费观看在线视频| 精品国产乱码久久久久久1区2区| 欧美性色黄大片| 久国产精品韩国三级视频| 一区二区欧美视频| 一区二区在线观看免费| 国产丝袜美腿一区二区三区| 8v天堂国产在线一区二区| 一本一道久久a久久精品| av一本久道久久综合久久鬼色| 成人禁用看黄a在线| 亚洲欧美日韩国产一区二区三区| 久久久不卡网国产精品一区| 日韩亚洲欧美综合| 欧美xxxx老人做受| 久久久久久久综合色一本| 欧美一区二区三区成人| 91精品国产综合久久小美女| 日韩三级在线观看| 国产精品污www在线观看| 亚洲精品乱码久久久久久| 午夜欧美电影在线观看| 国模一区二区三区白浆| 99国产精品久| 久久综合九色综合97婷婷女人 | 2022国产精品视频| 一区二区三区在线观看国产| 久久精品国内一区二区三区| 99久久伊人久久99| 久久久久久久久久久久电影| 亚洲亚洲精品在线观看| 国产精品初高中害羞小美女文| 亚洲男人天堂一区| 亚洲精品乱码久久久久久黑人| 午夜精品国产更新| 成人网在线免费视频| 欧美日韩精品一区二区天天拍小说 | 国产精品久久久久影视| 亚洲成人精品一区| 久久草av在线| 91女人视频在线观看| 久久久久久夜精品精品免费| 亚洲一区二区三区四区中文字幕| 麻豆精品国产传媒mv男同 | 麻豆国产欧美日韩综合精品二区 | 91国产视频在线观看| 国产日韩欧美精品一区| 国产精品一线二线三线| 精品日韩在线一区| 蜜臀av一区二区三区| 欧美性猛交xxxxxx富婆| 国产精品不卡视频| 国产成人综合自拍| 日韩欧美一级二级三级| 一区二区三区高清| 久久丁香综合五月国产三级网站| 91成人免费在线| 午夜电影久久久| 欧美人伦禁忌dvd放荡欲情| 亚洲天堂免费看| 麻豆精品在线视频| 欧美精品一区二区三区视频| 亚洲精品久久久久久国产精华液| 成人免费毛片aaaaa**| 国产精品乱人伦中文| 99久久精品国产一区| 亚洲欧美自拍偷拍色图| 丁香激情综合国产| 亚洲精选视频在线| 色94色欧美sute亚洲线路一久| 亚洲国产wwwccc36天堂| 色欧美片视频在线观看| 日本不卡免费在线视频| 精品人在线二区三区| 成人免费视频一区| 亚洲自拍另类综合| 国产偷国产偷亚洲高清人白洁| 蜜臀av性久久久久蜜臀aⅴ流畅 | 亚洲欧洲日韩一区二区三区| 国产成人精品一区二| 精品国产91久久久久久久妲己| 亚洲gay无套男同| 日韩一级片网址| 在线欧美日韩精品| 国产91精品入口| 奇米亚洲午夜久久精品| 一区二区三区在线观看欧美| 欧美经典一区二区| 欧美不卡一区二区三区| 欧美日韩一区二区欧美激情| 不卡高清视频专区| 国产成人丝袜美腿| 亚洲精品国产品国语在线app| 国产日韩欧美综合一区| 欧美日韩一二三| 欧美放荡的少妇| 91.成人天堂一区| 欧美一区二区三区四区五区| 精品视频一区二区三区免费| 91免费视频网| 91电影在线观看| 555www色欧美视频| 日韩三级中文字幕| 欧美大尺度电影在线| 精品不卡在线视频| 久久久久久久性| 中文字幕在线免费不卡| 久久久激情视频| 中文字幕一区二区三| 亚洲自拍偷拍麻豆| 韩国女主播成人在线| 国产精品白丝jk黑袜喷水| av一区二区久久| 51久久夜色精品国产麻豆| xvideos.蜜桃一区二区| 国产精品网曝门| 亚洲成人一区二区| 国产乱码精品一品二品| 一本久久综合亚洲鲁鲁五月天| 欧美精品免费视频| 中文成人综合网| 美女脱光内衣内裤视频久久网站 | 精品欧美乱码久久久久久| 17c精品麻豆一区二区免费| 日韩中文字幕av电影| 粉嫩嫩av羞羞动漫久久久| 欧美亚男人的天堂| 一区二区三区四区不卡视频| 亚洲第一在线综合网站| 91亚洲精品久久久蜜桃| 日韩欧美一级在线播放| 欧美国产日本韩| 美女在线视频一区| 成人激情小说网站| 国产激情一区二区三区| 欧美一二三四在线| 日韩精品国产精品| 精品国产乱码久久久久久图片| 国产精品女人毛片| 国产99久久久久久免费看农村| 欧美国产日韩在线观看| 国产一区二区三区四| 欧美精品一区二区三区蜜臀| 一区二区三区欧美视频| 在线视频一区二区三区| 午夜私人影院久久久久| 国产宾馆实践打屁股91| 亚洲欧美一区二区三区国产精品 | 亚洲激情av在线| 国产精品一区二区三区99| 久久久av毛片精品| 成人国产精品免费观看| 亚洲福利一区二区| 日本一区二区三区电影| 欧美一区二区三区免费视频| 99热这里都是精品| 91视频观看视频| 亚洲欧洲中文日韩久久av乱码| 香蕉影视欧美成人| 日本一区二区免费在线| 欧美视频中文字幕| 亚洲午夜免费电影| 国产69精品久久久久毛片| 欧美日韩成人在线| 国产精品一区二区91| 麻豆成人免费电影| 秋霞av亚洲一区二区三| 亚洲激情综合网| 成人免费在线播放视频| 欧美一区二区三区播放老司机| 麻豆久久久久久久| 国产精品入口麻豆原神| 成人91在线观看| 天堂资源在线中文精品| 久久久不卡网国产精品一区| 欧美美女bb生活片| 男女性色大片免费观看一区二区| 久久免费看少妇高潮|