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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ftpdlib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
	/* are we being passive? (should we wait for client to connect	 * to us rather than connecting to the client?)	 */	if (pSlot->status & FTPD_PASSIVE)	    {	    /* we're being passive.  wait for our client to connect to us. */	    addrLen = sizeof (struct sockaddr);	    if ((newSock = accept (pSlot->dataSock, (struct sockaddr *) &addr,				   &addrLen)) < 0)		{                ftpdCmdSend (pSlot, pSlot->cmdSock,                             425, "Can't open data connection",                             0, 0, 0, 0, 0, 0);                ftpdSockFree (&pSlot->dataSock);		/* we can't be passive no more */		pSlot->status &= ~FTPD_PASSIVE;		return (ERROR);		}            /*             * Enable the keep alive option to prevent misbehaving clients             * from locking the server.             */            if (setsockopt (newSock, SOL_SOCKET, SO_KEEPALIVE, (char *) &on,                            sizeof (on)) != 0)                {                ftpdSockFree (&pSlot->dataSock);                return (ERROR);                }	/* Check for window size validity */        if (ftpdWindowSize < 0 || ftpdWindowSize > 65536)            ftpdWindowSize = FTPD_WINDOW_SIZE;        /* set the window size  */        if (setsockopt(newSock, SOL_SOCKET, SO_SNDBUF,            (char *)&ftpdWindowSize, sizeof (ftpdWindowSize)))                printf("Couldn't set the Send Window to 10k\n");        if (setsockopt(newSock, SOL_SOCKET, SO_RCVBUF,            (char *)&ftpdWindowSize, sizeof (ftpdWindowSize)))                printf("Couldn't set the Send Window to 10k\n");	    /* replace the dataSock with our new connection */	    (void) close (pSlot->dataSock);	    pSlot->dataSock = newSock;	    /* N.B.: we stay passive */            if (ftpdCmdSend (pSlot, pSlot->cmdSock,                             150, "Opening %s mode data connection",                             pSlot->status & FTPD_ASCII_TYPE ? (int) "ASCII"                             : (int) "BINARY", 0, 0, 0, 0, 0) == ERROR)		{		(void) close (pSlot->dataSock);		return (ERROR);		}	    return (OK);	    }	else	    {	    /* reuse the old connection -- it's still useful */            if (ftpdCmdSend (pSlot, pSlot->cmdSock,                              125, "Using existing data connection",                             0, 0, 0, 0, 0, 0) == ERROR)		{	    	ftpdSockFree (&pSlot->dataSock);		return (ERROR);		}	    return (OK);	    }	}    else        {        /* Determine address for local end of connection. */        addrLen = sizeof (struct sockaddr);        if (getsockname (pSlot->cmdSock, (struct sockaddr *) &addr, &addrLen)                < 0)            {            return (ERROR);            }        /* Replace control port with default data port. */        addr.sin_port = htons (FTP_DATA_PORT);	/* open a new data socket */	if ((pSlot->dataSock = socket (AF_INET, SOCK_STREAM, 0)) < 0)	    { 	    return (ERROR);	    }	if (setsockopt (pSlot->dataSock, SOL_SOCKET,			SO_REUSEADDR, (char *) &on, sizeof (on)) < 0 ||	    bind (pSlot->dataSock, (struct sockaddr *) &addr,		  sizeof (addr)) < 0)	    {	    ftpdSockFree (&pSlot->dataSock);	    return (ERROR);	    }        /* Set socket address to PORT command values or default. */        bcopy ( (char *)&pSlot->dataAddr, (char *)&addr,                sizeof (struct sockaddr_in));	/* try until we get a connection to the client's port */	while (connect (pSlot->dataSock,			(struct sockaddr *) &addr, sizeof (addr)) < 0)	    {	    if ((errno & 0xffff) == EADDRINUSE && retry < FTPD_WAIT_MAX)	        {		taskDelay (FTPD_WAIT_INTERVAL * sysClkRateGet ());		retry += FTPD_WAIT_INTERVAL;		continue;		}	    /* timeout -- we give up */            ftpdCmdSend (pSlot, pSlot->cmdSock,                         425, "Can't build data connection",                         0, 0, 0, 0, 0, 0);	    ftpdSockFree (&pSlot->dataSock);	    return (ERROR);	    }            /*             * Enable the keep alive option to prevent misbehaving clients             * from locking the secondary task during file transfers.             */            if (setsockopt (pSlot->dataSock, SOL_SOCKET, SO_KEEPALIVE,                             (char *) &on, sizeof (on)) != 0)                {                ftpdSockFree (&pSlot->dataSock);                return (ERROR);                }	    /* Check for window size validity */	    if (ftpdWindowSize < 0 || ftpdWindowSize > 65536)		ftpdWindowSize = FTPD_WINDOW_SIZE;	    /* set the window size  */	    if (setsockopt(pSlot->dataSock, SOL_SOCKET, SO_SNDBUF,		(char *)&ftpdWindowSize, sizeof (ftpdWindowSize)))		    printf("Couldn't set the Send Window to 10k\n");	    if (setsockopt(pSlot->dataSock, SOL_SOCKET, SO_RCVBUF,		(char *)&ftpdWindowSize, sizeof (ftpdWindowSize)))		    printf("Couldn't set the Send Window to 10k\n");            if (ftpdCmdSend (pSlot, pSlot->cmdSock,                              150, "Opening %s mode data connection",                             pSlot->status & FTPD_ASCII_TYPE ? (int) "ASCII" :                             (int) "BINARY", 0, 0, 0, 0, 0) == ERROR)		{		ftpdSockFree (&pSlot->dataSock);		return (ERROR);		}	}    return (OK);    }/********************************************************************************* ftpdDataStreamSend - send FTP data over data connection** When our FTP client does a "RETR" (send me a file) and we find an existing* file, ftpdWorkTask() will call us to perform the actual shipment of the* file in question over the data connection.** We do the initialization of the new data connection ourselves here* and make sure that everything is fine and dandy before shipping the* contents of the file.  Special attention is given to the type of* the file representation -- ASCII or BINARY.  If it's binary, we* don't perform the prepending of "\r" character in front of each* "\n" character.  Otherwise, we have to do this for the ASCII files.** SEE ALSO:* ftpdDataStreamReceive  which is symmetric to this function.*/LOCAL void ftpdDataStreamSend    (    FTPD_SESSION_DATA   *pSlot,         /* pointer to our session slot */    FILE                *inStream       /* pointer to the input file stream */    )    {    FAST char	*pBuf;			/* pointer to the session buffer */    FAST int	netFd;			/* output socket */    FAST int	fileFd;			/* input file descriptor */    FAST char	ch;			/* character holder */    FAST int	cnt;			/* number of chars read/written */    FAST FILE	*outStream;		/* buffered output socket stream */    int		retval = 0;    /* get a fresh connection or reuse the old one */    if (ftpdDataConnGet (pSlot) == ERROR)	{	dataError (pSlot);	return;	}    pBuf = &pSlot->buf [0];    if (pSlot->status & FTPD_ASCII_TYPE)	{	/* ASCII representation */	/* get a buffered I/O stream for this output data socket */	if ((outStream = fdopen (pSlot->dataSock, "w")) == NULL)	    {	    dataError (pSlot);	    return;	    }	/* write out the contents of the file and do the '\r' prepending */	while ((ch = getc (inStream)) != (char) EOF)	    {	    pSlot->byteCount++;	    /* if '\n' is encountered, we prepend a '\r' */	    if (ch == '\n')		{		if (ferror (outStream))		    {		    dataError (pSlot);		    fclose (outStream);		    return;		    }		if (putc ('\r', outStream) == EOF)		    {		    dataError (pSlot);		    fclose (outStream);		    return;		    }		}	    	if (putc (ch, outStream) == EOF)		{		dataError (pSlot);		fclose (outStream);		return;		}            /* Abort the file transfer if a shutdown is in progress. */            if (ch == '\n' && ftpsShutdownFlag)                {		dataError (pSlot);                fclose (outStream);                return;                }	    }	/* flush it out */	(void) fflush (outStream);	if (ferror (inStream))	    {	    /* error in reading the file */	    fileError (pSlot);	    fclose (outStream);	    return;	    }	if (ferror (outStream))	    {	    /* error in sending the file */	    dataError (pSlot);	    fclose (outStream);	    return;	    }	fclose (outStream);	/* everything is okay */	transferOkay (pSlot);	}    else if (pSlot->status & FTPD_BINARY_TYPE)	{	/* BINARY representation */	netFd = pSlot->dataSock;	/* get a raw descriptor for this input file */	fileFd = fileno (inStream);	/* unbuffered block I/O between file and network */	while ((cnt = read (fileFd, pBuf, BUFSIZE)) > 0 &&	       (retval = write (netFd, pBuf, cnt)) == cnt)            {	    pSlot->byteCount += cnt;            if (ftpsShutdownFlag)                {                /* Abort the file transfer if a shutdown is in progress. */                cnt = 1;                break;                }            }	/* cnt should be zero if the transfer ended normally */	if (cnt != 0)	    {	    if (cnt < 0)		{		fileError (pSlot);		return;		}	    ftpdDebugMsg ("read %d bytes, wrote %d bytes\n", cnt, retval,0,0);	    dataError (pSlot);	    return;	    }	transferOkay (pSlot);	}    else	unImplementedType (pSlot);	/* invalide representation type */    }/********************************************************************************* ftpdDataStreamReceive - receive FTP data over data connection** When our FTP client requests "STOR" command and we were able to* create a file requested, ftpdWorkTask() will call ftpdDataStreamReceive* to actually carry out the request -- receiving the contents of the* named file and storing it in the new file created.** We do the initialization of the new data connection ourselves here* and make sure that everything is fine and dandy before receiving the* contents of the file.  Special attention is given to the type of* the file representation -- ASCII or BINARY.  If it's binary, we* don't perform the handling of '\r' character in front of each* '\n' character.  Otherwise, we have to do this for the ASCII files.** SEE ALSO:* ftpdDataStreamSend which is symmetric to this function.*/LOCAL void ftpdDataStreamReceive    (    FTPD_SESSION_DATA   *pSlot,    FILE                *outStream    )    {    FAST char	*pBuf;		/* pointer to the session buffer */    FAST char 	ch;		/* character holder */    FAST FILE	*inStream;	/* buffered input file stream for data socket */    FAST int	fileFd;		/* output file descriptor */    FAST int	netFd;		/* network file descriptor */    FAST BOOL	dontPutc;	/* flag to prevent bogus chars */    FAST int	cnt;		/* number of chars read/written */    /* get a fresh data connection or reuse the old one */    if (ftpdDataConnGet (pSlot) == ERROR)	{	dataError (pSlot);	return;	}    pBuf = &pSlot->buf [0];    if (pSlot->status & FTPD_ASCII_TYPE)	{	/* ASCII representation */	/* get a buffer I/O stream for the input data socket connection */	if ((inStream = fdopen (pSlot->dataSock, "r")) == NULL)	    {	    dataError (pSlot);	    return;	    }	/* read in the contents of the file while doing the '\r' handling */	while ((ch = getc (inStream)) != (char) EOF)	    {	    dontPutc = FALSE;	    pSlot->byteCount++;	    /* a rather strange handling of sequences of '\r' chars */	    while (ch == '\r')		{		if (ferror (outStream))		    {		    dataError (pSlot);		    fclose (inStream);		    return;		    }		/* replace bogus chars between '\r' and '\n' chars with '\r' */		if ((ch = getc (inStream)) != '\n')		    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久人人爱| 91在线国产福利| 欧美日韩dvd在线观看| 亚洲欧美乱综合| 91电影在线观看| 一个色综合网站| 欧美午夜一区二区| 日韩精品免费专区| 欧美刺激午夜性久久久久久久| 奇米精品一区二区三区四区| 欧美成人精品高清在线播放 | 欧美一级夜夜爽| 久久精品国产第一区二区三区| 欧美精品一区男女天堂| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 日韩一区二区三| 成人免费看视频| 中文字幕亚洲不卡| 欧美日韩一级二级三级| 美女诱惑一区二区| 亚洲国产精品t66y| 欧美午夜精品久久久久久孕妇| 全部av―极品视觉盛宴亚洲| 国产肉丝袜一区二区| 在线日韩av片| 久久国产精品免费| 1区2区3区欧美| 日韩欧美www| 99久久精品99国产精品| 男男成人高潮片免费网站| 国产视频一区二区在线观看| 欧美日韩中文字幕一区二区| 国产成人免费视| 日韩不卡一区二区三区 | 欧美精品日韩精品| 国产中文字幕精品| 有坂深雪av一区二区精品| 精品电影一区二区三区| 色婷婷久久久综合中文字幕| 久久精品999| 亚洲国产精品久久久男人的天堂 | 成人综合婷婷国产精品久久免费| 亚洲综合男人的天堂| 久久精品日产第一区二区三区高清版 | 777xxx欧美| 成人高清av在线| 麻豆成人久久精品二区三区小说| 亚洲精品日日夜夜| 久久久精品免费观看| 宅男在线国产精品| 91美女视频网站| 国产a久久麻豆| 日韩中文字幕亚洲一区二区va在线| 国产精品高清亚洲| 日韩免费一区二区三区在线播放| 在线观看一区二区视频| 99久久精品国产导航| 国产精品12区| 精品一区二区三区在线视频| 日日夜夜免费精品| 无吗不卡中文字幕| 亚洲精品v日韩精品| 国产精品久久久久久久久免费相片 | 成人中文字幕合集| 国产一区二区精品在线观看| 秋霞影院一区二区| 日韩av电影一区| 日韩专区中文字幕一区二区| 亚洲 欧美综合在线网络| 亚洲激情图片qvod| 亚洲日本在线a| 亚洲欧洲一区二区三区| 国产精品免费看片| 国产精品午夜在线| 国产精品日韩精品欧美在线| 国产精品午夜久久| 欧美激情一区二区三区在线| 国产精品丝袜在线| 国产精品免费丝袜| 中文字幕一区二区不卡| 中文字幕日韩欧美一区二区三区| 国产欧美视频一区二区| 欧美激情中文字幕| 国产精品传媒在线| 亚洲欧洲精品成人久久奇米网| 国产精品乱码妇女bbbb| 日韩一区中文字幕| 亚洲色图在线播放| 亚洲激情在线激情| 香蕉成人伊视频在线观看| 香蕉乱码成人久久天堂爱免费| 日韩专区一卡二卡| 国内精品自线一区二区三区视频| 国内偷窥港台综合视频在线播放| 国产iv一区二区三区| 91丝袜美腿高跟国产极品老师| 99久久亚洲一区二区三区青草| 欧美日韩一区久久| 欧美一级搡bbbb搡bbbb| 2019国产精品| 国产精品福利一区二区| 亚洲综合小说图片| 人妖欧美一区二区| 国产精品亚洲专一区二区三区 | 亚洲欧美一区二区视频| 夜夜爽夜夜爽精品视频| 蜜桃精品视频在线观看| 国产成都精品91一区二区三| 不卡高清视频专区| 欧美日韩一区在线| 久久久综合激的五月天| 亚洲精品国产无天堂网2021 | 韩国精品主播一区二区在线观看| 懂色av一区二区三区免费观看| 91原创在线视频| 欧美一区二区精品久久911| 精品国产a毛片| 日韩码欧中文字| 麻豆精品视频在线| 成人综合在线观看| 欧美一区二区视频在线观看2022| 国产精品乱人伦一区二区| 亚洲猫色日本管| 久久 天天综合| 91蜜桃网址入口| 26uuu成人网一区二区三区| 一区二区三区精品| 国产不卡一区视频| 欧美精品日韩综合在线| 一区二区中文视频| 日本成人在线不卡视频| 91视频精品在这里| 久久综合色8888| 亚洲影视资源网| 免费成人性网站| 欧美探花视频资源| 国产精品视频线看| 麻豆免费精品视频| 欧美蜜桃一区二区三区| 亚洲视频一二三| 成人国产精品视频| 欧美一区二区福利在线| 亚洲自拍欧美精品| 99在线精品一区二区三区| 欧美mv和日韩mv国产网站| 亚洲五月六月丁香激情| 成人黄页在线观看| 久久一留热品黄| 日韩成人免费电影| 国产99精品国产| 欧美丰满高潮xxxx喷水动漫 | 天天影视涩香欲综合网| 一本久久综合亚洲鲁鲁五月天 | 亚洲午夜电影在线| 91免费看视频| 国产精品剧情在线亚洲| 免费成人在线观看视频| 欧美高清视频一二三区| 亚洲美女精品一区| 91在线高清观看| 1024亚洲合集| 99视频精品在线| 精品国产髙清在线看国产毛片| 日韩av一区二区三区四区| 6080亚洲精品一区二区| 亚洲午夜一二三区视频| 欧美亚洲一区二区在线观看| 一区二区三区在线视频免费 | 亚洲啪啪综合av一区二区三区| 国产成人小视频| 中文字幕精品综合| 风间由美一区二区av101| 久久婷婷国产综合精品青草| 国内精品久久久久影院色| 精品美女被调教视频大全网站| 麻豆国产精品一区二区三区| 精品欧美一区二区久久| 国产精品亚洲一区二区三区在线| 久久久久88色偷偷免费| 成人黄色大片在线观看| 亚洲少妇30p| 欧美日免费三级在线| 亚洲国产成人精品视频| 日韩一级高清毛片| 九九热在线视频观看这里只有精品| 欧美精品一区二区不卡| 高清国产一区二区| 日韩一区中文字幕| 欧美日韩五月天| 久久99久久精品| 国产精品久久久久一区二区三区共| 在线一区二区三区四区五区| 香蕉成人伊视频在线观看| 精品国产乱码久久久久久图片| 国产91在线|亚洲| 一区二区三区精品| 欧美一级黄色片| 99免费精品视频| 天堂成人免费av电影一区| 久久久亚洲综合|