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

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

?? b_sock.c

?? OpenSSL 0.9.8k 最新版OpenSSL
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* crypto/bio/b_sock.c *//* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. *  * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to.  The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code.  The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). *  * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. *  * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *    "This product includes cryptographic software written by *     Eric Young (eay@cryptsoft.com)" *    The word 'cryptographic' can be left out if the rouines from the library *    being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from  *    the apps directory (application code) you must include an acknowledgement: *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" *  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *  * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed.  i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */#include <stdio.h>#include <stdlib.h>#include <errno.h>#define USE_SOCKETS#include "cryptlib.h"#include <openssl/bio.h>#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_BSDSOCK)#include <netdb.h>#if defined(NETWARE_CLIB)#include <sys/ioctl.h>NETDB_DEFINE_CONTEXT#endif#endif#ifndef OPENSSL_NO_SOCK#ifdef OPENSSL_SYS_WIN16#define SOCKET_PROTOCOL 0 /* more microsoft stupidity */#else#define SOCKET_PROTOCOL IPPROTO_TCP#endif#ifdef SO_MAXCONN#define MAX_LISTEN  SO_MAXCONN#elif defined(SOMAXCONN)#define MAX_LISTEN  SOMAXCONN#else#define MAX_LISTEN  32#endif#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))static int wsa_init_done=0;#endif#if 0static unsigned long BIO_ghbn_hits=0L;static unsigned long BIO_ghbn_miss=0L;#define GHBN_NUM	4static struct ghbn_cache_st	{	char name[129];	struct hostent *ent;	unsigned long order;	} ghbn_cache[GHBN_NUM];#endifstatic int get_ip(const char *str,unsigned char *ip);#if 0static void ghbn_free(struct hostent *a);static struct hostent *ghbn_dup(struct hostent *a);#endifint BIO_get_host_ip(const char *str, unsigned char *ip)	{	int i;	int err = 1;	int locked = 0;	struct hostent *he;	i=get_ip(str,ip);	if (i < 0)		{		BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_INVALID_IP_ADDRESS);		goto err;		}	/* At this point, we have something that is most probably correct	   in some way, so let's init the socket. */	if (BIO_sock_init() != 1)		return 0; /* don't generate another error code here */	/* If the string actually contained an IP address, we need not do	   anything more */	if (i > 0) return(1);	/* do a gethostbyname */	CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);	locked = 1;	he=BIO_gethostbyname(str);	if (he == NULL)		{		BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_BAD_HOSTNAME_LOOKUP);		goto err;		}	/* cast to short because of win16 winsock definition */	if ((short)he->h_addrtype != AF_INET)		{		BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET);		goto err;		}	for (i=0; i<4; i++)		ip[i]=he->h_addr_list[0][i];	err = 0; err:	if (locked)		CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME);	if (err)		{		ERR_add_error_data(2,"host=",str);		return 0;		}	else		return 1;	}int BIO_get_port(const char *str, unsigned short *port_ptr)	{	int i;	struct servent *s;	if (str == NULL)		{		BIOerr(BIO_F_BIO_GET_PORT,BIO_R_NO_PORT_DEFINED);		return(0);		}	i=atoi(str);	if (i != 0)		*port_ptr=(unsigned short)i;	else		{		CRYPTO_w_lock(CRYPTO_LOCK_GETSERVBYNAME);		/* Note: under VMS with SOCKETSHR, it seems like the first		 * parameter is 'char *', instead of 'const char *'		 */#ifndef CONST_STRICT		s=getservbyname((char *)str,"tcp");#else		s=getservbyname(str,"tcp");#endif		if(s != NULL)			*port_ptr=ntohs((unsigned short)s->s_port);		CRYPTO_w_unlock(CRYPTO_LOCK_GETSERVBYNAME);		if(s == NULL)			{			if (strcmp(str,"http") == 0)				*port_ptr=80;			else if (strcmp(str,"telnet") == 0)				*port_ptr=23;			else if (strcmp(str,"socks") == 0)				*port_ptr=1080;			else if (strcmp(str,"https") == 0)				*port_ptr=443;			else if (strcmp(str,"ssl") == 0)				*port_ptr=443;			else if (strcmp(str,"ftp") == 0)				*port_ptr=21;			else if (strcmp(str,"gopher") == 0)				*port_ptr=70;#if 0			else if (strcmp(str,"wais") == 0)				*port_ptr=21;#endif			else				{				SYSerr(SYS_F_GETSERVBYNAME,get_last_socket_error());				ERR_add_error_data(3,"service='",str,"'");				return(0);				}			}		}	return(1);	}int BIO_sock_error(int sock)	{	int j,i;	int size;		 	size=sizeof(int);	/* Note: under Windows the third parameter is of type (char *)	 * whereas under other systems it is (void *) if you don't have	 * a cast it will choke the compiler: if you do have a cast then	 * you can either go for (char *) or (void *).	 */	i=getsockopt(sock,SOL_SOCKET,SO_ERROR,(void *)&j,(void *)&size);	if (i < 0)		return(1);	else		return(j);	}#if 0long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)	{	int i;	char **p;	switch (cmd)		{	case BIO_GHBN_CTRL_HITS:		return(BIO_ghbn_hits);		/* break; */	case BIO_GHBN_CTRL_MISSES:		return(BIO_ghbn_miss);		/* break; */	case BIO_GHBN_CTRL_CACHE_SIZE:		return(GHBN_NUM);		/* break; */	case BIO_GHBN_CTRL_GET_ENTRY:		if ((iarg >= 0) && (iarg <GHBN_NUM) &&			(ghbn_cache[iarg].order > 0))			{			p=(char **)parg;			if (p == NULL) return(0);			*p=ghbn_cache[iarg].name;			ghbn_cache[iarg].name[128]='\0';			return(1);			}		return(0);		/* break; */	case BIO_GHBN_CTRL_FLUSH:		for (i=0; i<GHBN_NUM; i++)			ghbn_cache[i].order=0;		break;	default:		return(0);		}	return(1);	}#endif#if 0static struct hostent *ghbn_dup(struct hostent *a)	{	struct hostent *ret;	int i,j;	MemCheck_off();	ret=(struct hostent *)OPENSSL_malloc(sizeof(struct hostent));	if (ret == NULL) return(NULL);	memset(ret,0,sizeof(struct hostent));	for (i=0; a->h_aliases[i] != NULL; i++)		;	i++;	ret->h_aliases = (char **)OPENSSL_malloc(i*sizeof(char *));	if (ret->h_aliases == NULL)		goto err;	memset(ret->h_aliases, 0, i*sizeof(char *));	for (i=0; a->h_addr_list[i] != NULL; i++)		;	i++;	ret->h_addr_list=(char **)OPENSSL_malloc(i*sizeof(char *));	if (ret->h_addr_list == NULL)		goto err;	memset(ret->h_addr_list, 0, i*sizeof(char *));	j=strlen(a->h_name)+1;	if ((ret->h_name=OPENSSL_malloc(j)) == NULL) goto err;	memcpy((char *)ret->h_name,a->h_name,j);	for (i=0; a->h_aliases[i] != NULL; i++)		{		j=strlen(a->h_aliases[i])+1;		if ((ret->h_aliases[i]=OPENSSL_malloc(j)) == NULL) goto err;		memcpy(ret->h_aliases[i],a->h_aliases[i],j);		}	ret->h_length=a->h_length;	ret->h_addrtype=a->h_addrtype;	for (i=0; a->h_addr_list[i] != NULL; i++)		{		if ((ret->h_addr_list[i]=OPENSSL_malloc(a->h_length)) == NULL)			goto err;		memcpy(ret->h_addr_list[i],a->h_addr_list[i],a->h_length);		}	if (0)		{err:			if (ret != NULL)			ghbn_free(ret);		ret=NULL;		}	MemCheck_on();	return(ret);	}static void ghbn_free(struct hostent *a)	{	int i;	if(a == NULL)	    return;	if (a->h_aliases != NULL)		{		for (i=0; a->h_aliases[i] != NULL; i++)			OPENSSL_free(a->h_aliases[i]);		OPENSSL_free(a->h_aliases);		}	if (a->h_addr_list != NULL)		{		for (i=0; a->h_addr_list[i] != NULL; i++)			OPENSSL_free(a->h_addr_list[i]);		OPENSSL_free(a->h_addr_list);		}	if (a->h_name != NULL) OPENSSL_free(a->h_name);	OPENSSL_free(a);	}#endifstruct hostent *BIO_gethostbyname(const char *name)	{#if 1	/* Caching gethostbyname() results forever is wrong,	 * so we have to let the true gethostbyname() worry about this */#if (defined(NETWARE_BSDSOCK) && !defined(__NOVELL_LIBC__))	return gethostbyname((char*)name);#else	return gethostbyname(name);#endif#else	struct hostent *ret;	int i,lowi=0,j;	unsigned long low= (unsigned long)-1;#  if 0	/* It doesn't make sense to use locking here: The function interface	 * is not thread-safe, because threads can never be sure when	 * some other thread destroys the data they were given a pointer to.	 */	CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);#  endif	j=strlen(name);	if (j < 128)		{		for (i=0; i<GHBN_NUM; i++)			{			if (low > ghbn_cache[i].order)				{				low=ghbn_cache[i].order;				lowi=i;				}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久婷婷国产综合精品| 国产成人av福利| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美videofree性高清杂交| 日韩精品一区在线| 久久久久久免费| 国产精品久久三| 亚洲视频在线一区观看| 一区二区三区中文字幕精品精品 | 久久综合色鬼综合色| 91网页版在线| 欧美韩国日本不卡| 久久精品人人做人人爽97| 久久久不卡网国产精品二区| 久久久久久久一区| 亚洲欧美综合网| 亚洲午夜久久久久| 久久精品国产999大香线蕉| 九色porny丨国产精品| 国产成人99久久亚洲综合精品| 亚洲欧美一区二区视频| 亚洲另类一区二区| 午夜免费欧美电影| 国产成人在线视频网址| 91麻豆产精品久久久久久| 欧美日韩国产高清一区二区三区 | 91精品国产入口在线| 精品国产一区二区国模嫣然| 欧美激情综合网| 一区二区在线观看av| 美女高潮久久久| 99久久亚洲一区二区三区青草 | 国产日韩欧美麻豆| 亚洲一区影音先锋| 国产精品影视在线| 欧美精品第1页| 国产精品青草久久| 人人精品人人爱| 色综合激情久久| 久久综合色播五月| 午夜av一区二区| 成人午夜视频在线观看| 91精品国产福利| 伊人性伊人情综合网| 国产一区二区精品久久91| 欧美伊人精品成人久久综合97| 久久久久国产成人精品亚洲午夜| 亚洲午夜电影网| 97国产一区二区| 欧美国产欧美综合| 麻豆国产欧美日韩综合精品二区 | 国产精品福利影院| 日本中文一区二区三区| www.成人网.com| 欧美一级免费观看| 蜜臀av性久久久久av蜜臀妖精| 成人免费视频网站在线观看| 欧美一区二区三区人| 亚洲国产sm捆绑调教视频| 国产成人免费9x9x人网站视频| 日韩欧美在线网站| 视频一区欧美日韩| 在线一区二区视频| 亚洲三级电影网站| 91视频国产观看| 国产日韩欧美不卡| 成人免费看片app下载| 久久综合久久综合九色| 国模无码大尺度一区二区三区| 日韩三级在线免费观看| 欧美aⅴ一区二区三区视频| 欧美三级午夜理伦三级中视频| 综合久久一区二区三区| 一本大道av一区二区在线播放| 椎名由奈av一区二区三区| 亚洲欧美在线视频| 看电视剧不卡顿的网站| 911国产精品| 麻豆久久久久久久| 日韩欧美国产wwwww| 久久国产精品99精品国产| 精品精品国产高清一毛片一天堂| 美女脱光内衣内裤视频久久网站| 日韩欧美精品在线视频| 国产一区美女在线| 欧美激情一区在线观看| 不卡视频一二三| 亚洲综合成人网| 欧美一级片在线| 国产精品自拍在线| 亚洲丝袜精品丝袜在线| 欧美中文字幕一区二区三区| 午夜欧美2019年伦理| 精品日韩99亚洲| 成人av一区二区三区| 亚洲精品免费看| 91精品国产色综合久久久蜜香臀| 91丨porny丨最新| 欧美男同性恋视频网站| 免费观看在线色综合| 337p粉嫩大胆噜噜噜噜噜91av| 成人自拍视频在线观看| 亚洲欧美日韩国产中文在线| 欧美午夜片在线看| 国产精品资源在线观看| 亚洲另类在线一区| 精品剧情v国产在线观看在线| 国产69精品久久久久毛片| 亚洲成人一区在线| 国产欧美精品区一区二区三区| 在线观看日产精品| 国产精品一品视频| 日韩电影网1区2区| 自拍偷拍亚洲综合| 精品国产91亚洲一区二区三区婷婷| 色哟哟精品一区| 国产精品白丝jk黑袜喷水| 亚洲一线二线三线视频| 国产偷国产偷精品高清尤物 | 国产成人免费视频网站| 久久久久亚洲蜜桃| 欧美视频精品在线| 国产99精品视频| 美女免费视频一区| 亚洲综合激情另类小说区| 国产日韩精品一区二区浪潮av| 91精品免费观看| 欧美性感一区二区三区| caoporen国产精品视频| 国产一区不卡视频| 蜜桃视频在线观看一区| 丝袜美腿成人在线| 亚洲国产日韩一区二区| 中文字幕一区在线观看视频| 久久人人爽爽爽人久久久| 91精品国产91久久综合桃花| 欧美日韩一区二区三区在线看| 成人sese在线| 岛国精品在线观看| 国产精品一区二区不卡| 国产一本一道久久香蕉| 久久91精品国产91久久小草| 日本在线不卡视频| 依依成人综合视频| 色综合咪咪久久| 粉嫩绯色av一区二区在线观看| 精品一区二区三区不卡| 日本伊人色综合网| 日本在线不卡一区| 麻豆精品新av中文字幕| 蜜臀久久99精品久久久久宅男 | 亚洲三级免费观看| 亚洲精品精品亚洲| 自拍偷拍欧美精品| 亚洲女与黑人做爰| 亚洲国产另类av| 日韩专区在线视频| 视频一区欧美精品| 久久精品国产99国产| 精久久久久久久久久久| 国产精品99久久久| 成人激情校园春色| 日本道在线观看一区二区| 欧美日韩一区二区三区不卡| 欧美一区二区网站| 欧美精品一区二区三区高清aⅴ | 国产一区欧美二区| 极品尤物av久久免费看| 精品一区二区影视| 床上的激情91.| 91老司机福利 在线| 欧美日本国产一区| 精品少妇一区二区三区日产乱码 | 亚洲一区二区偷拍精品| 日韩精品亚洲一区| 激情综合网天天干| 91网站黄www| 日韩精品专区在线影院观看| 国产日韩欧美电影| 午夜精品123| 国产激情精品久久久第一区二区| 91欧美一区二区| 欧美一级欧美三级在线观看 | 欧美精品丝袜久久久中文字幕| 精品久久国产老人久久综合| 中文字幕不卡的av| 亚洲成人中文在线| 成人深夜在线观看| 91精品蜜臀在线一区尤物| 国产精品久久久久久久久搜平片 | 国产精品乱码人人做人人爱| 亚洲国产精品欧美一二99| 国产精品18久久久久| 欧美撒尿777hd撒尿| 国产欧美一区二区精品性| 日韩电影免费在线看| 91在线你懂得| 久久人人97超碰com| 午夜精品久久久久久不卡8050| av午夜一区麻豆|