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

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

?? ftpdlib.c

?? vxworks的完整的源代碼
?? 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')		    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久中文娱乐网| 日韩精品亚洲一区二区三区免费| 精品国产伦一区二区三区观看体验| 91丨九色丨黑人外教| 成人综合婷婷国产精品久久蜜臀| 久久99国内精品| 日韩电影一区二区三区| 亚洲一区二区三区四区在线观看| ...av二区三区久久精品| 久久久久88色偷偷免费| 日韩丝袜美女视频| 久久久噜噜噜久久人人看| 国产欧美精品区一区二区三区| 日本一区二区三级电影在线观看| 国产精品久久夜| 一区二区三区中文免费| 亚洲成人av中文| 亚洲精品成人精品456| 国产精品拍天天在线| 精品国产91久久久久久久妲己 | 亚洲欧洲日本在线| 国产欧美一区二区三区网站 | **性色生活片久久毛片| 日本一区二区在线不卡| 国产三级精品在线| 欧美国产综合色视频| 国产精品美女一区二区在线观看| 欧美激情一区不卡| 国产精品视频一区二区三区不卡| 久久久久国产精品麻豆ai换脸| 久久久99免费| 亚洲欧洲日韩av| 亚洲国产美女搞黄色| 亚洲成人1区2区| 日韩精品视频网站| 三级欧美韩日大片在线看| 亚洲午夜精品在线| 七七婷婷婷婷精品国产| 国产乱淫av一区二区三区| 国产999精品久久久久久绿帽| 99久久精品国产观看| 欧美色老头old∨ideo| 欧美一区二区在线视频| 久久久亚洲精品一区二区三区| 国产精品你懂的在线| 亚洲一级二级三级在线免费观看| 日韩av在线发布| 国产麻豆精品theporn| 91丨porny丨最新| 欧美一区二区人人喊爽| 久久亚洲欧美国产精品乐播| 国产精品久久久久aaaa| 一区二区成人在线视频| 免费观看日韩av| 成人动漫av在线| 91麻豆精品国产91久久久资源速度| 精品乱人伦小说| 亚洲同性同志一二三专区| 五月开心婷婷久久| 国产激情91久久精品导航| 日本高清无吗v一区| 欧美一级免费大片| 国产精品福利一区二区| 亚洲成人动漫在线观看| 粉嫩av亚洲一区二区图片| 在线观看中文字幕不卡| 久久五月婷婷丁香社区| 亚洲综合成人在线视频| 国产一区二区三区日韩| 日本韩国欧美一区二区三区| 久久综合色综合88| 亚洲综合色丁香婷婷六月图片| 久久99国产精品久久99| 一本久久a久久精品亚洲| 欧美大片顶级少妇| 亚洲另类在线一区| 国产一区二区三区香蕉| 日本福利一区二区| 国产午夜亚洲精品午夜鲁丝片| 亚洲综合999| 成人免费视频一区二区| 欧美一级二级在线观看| 国产亚洲精品福利| 日韩av中文字幕一区二区 | 欧美日韩一区不卡| 国产色综合一区| 蜜臀a∨国产成人精品| 91久久国产综合久久| 久久噜噜亚洲综合| 人人狠狠综合久久亚洲| 色成年激情久久综合| 国产亚洲成av人在线观看导航| 三级久久三级久久久| 一本大道久久a久久综合婷婷| 久久午夜羞羞影院免费观看| 日韩va欧美va亚洲va久久| 91九色最新地址| 亚洲视频狠狠干| 国产成人免费视频网站高清观看视频| 欧美精品 国产精品| 一区二区三区在线观看欧美| 懂色一区二区三区免费观看| 欧美tickle裸体挠脚心vk| 首页综合国产亚洲丝袜| 97se狠狠狠综合亚洲狠狠| 日韩精品一区二区三区中文精品 | 日本一区二区三区电影| 久久国内精品自在自线400部| 欧美视频在线观看一区二区| 亚洲激情五月婷婷| 97se狠狠狠综合亚洲狠狠| 国产精品私人影院| 成人一级片在线观看| 精品第一国产综合精品aⅴ| 蜜臀99久久精品久久久久久软件| 欧美乱熟臀69xxxxxx| 亚洲第一成年网| 欧美影片第一页| 亚洲综合av网| 欧美日韩一区二区欧美激情| 亚洲高清一区二区三区| 欧美三级韩国三级日本一级| 亚洲一区二区五区| 欧美性大战久久久久久久| 亚洲一区二区美女| 欧美日韩精品一区二区三区 | 韩国精品主播一区二区在线观看 | 国产一区二区三区免费播放| 欧美一二三在线| 开心九九激情九九欧美日韩精美视频电影| 欧美一区二区久久| 国产精品一区二区久久不卡| 亚洲欧洲精品成人久久奇米网| 欧美日韩在线播放| 黄色日韩网站视频| 成人欧美一区二区三区| 欧美精三区欧美精三区| 国产精品综合二区| 亚洲精品国产一区二区三区四区在线| 在线视频一区二区三区| 视频在线在亚洲| 欧美一区日韩一区| 日本少妇一区二区| 久久精品一二三| 国产精品中文字幕日韩精品 | 亚洲线精品一区二区三区| 欧美久久一二三四区| 日本va欧美va欧美va精品| 精品国产一区二区亚洲人成毛片 | 午夜久久福利影院| 亚洲图片欧美综合| 国产性天天综合网| 亚洲1区2区3区4区| 国产精品视频线看| 亚洲精品一区二区三区蜜桃下载 | 99久久综合狠狠综合久久| 日韩精品亚洲一区| 国产精品亲子乱子伦xxxx裸| 日韩一区二区三区电影在线观看| av电影在线不卡| 国产在线精品一区二区三区不卡 | 欧美色图天堂网| 成人性生交大片免费看在线播放| 五月激情综合婷婷| 亚洲人成网站色在线观看| 精品国产一区二区三区久久久蜜月| 在线精品亚洲一区二区不卡| 成人久久视频在线观看| 另类欧美日韩国产在线| 亚洲第四色夜色| 亚洲激情欧美激情| 国产精品卡一卡二| 精品国产一区二区三区忘忧草 | 成人h精品动漫一区二区三区| 国产精品一线二线三线| 国产一区二区三区不卡在线观看| 捆绑变态av一区二区三区| 久久精品理论片| 狠狠色狠狠色综合| 国产成人在线免费观看| 国产麻豆午夜三级精品| 国产麻豆一精品一av一免费| 国产精品自产自拍| 成人国产精品视频| 91亚洲精品久久久蜜桃网站| 91丨porny丨中文| 在线看日本不卡| 欧美三级电影网| 欧美一区二区福利在线| 精品日韩99亚洲| 久久人人超碰精品| 中文一区一区三区高中清不卡| 中文字幕一区二区三区视频 | 欧美美女bb生活片| 欧美一区二区黄色| 久久久久久一级片| 国产精品久久久久四虎| 亚洲欧美国产三级| 亚洲成av人影院| 久久国产精品99久久人人澡|