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

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

?? ftpdlib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
    if (ftpsShutdownFlag)        {        if (ftpsCurrentClients == 0)            semGive (ftpsSignalSem);        }    semGive (ftpsMutexSem);    return;    }/********************************************************************************* ftpdWorkTask - main protocol processor for the FTP service** This function handles all the FTP protocol requests by parsing* the request string and performing appropriate actions and returning* the result strings.  The main body of this function is a large* FOREVER loop which reads in FTP request commands from the client* located on the other side of the connection.  If the result of* parsing the request indicates a valid command, ftpdWorkTask() will* call appropriate functions to handle the request and return the* result of the request.  The parsing of the requests are done via* a list of strncmp routines for simplicity.** RETURNS: N/A** ERRNO: N/A** NOMANUAL** INTERNAL* To handle multiple simultaneous connections, this routine and all secondary* routines which process client commands must be re-entrant. If the server's* halt routine is started, the shutdown flag is set, causing this routine to* exit after completing any operation already in progress.*/LOCAL STATUS ftpdWorkTask    (    FTPD_SESSION_DATA   *pSlot  /* pointer to the active slot to be handled */    )    {    FAST int		sock;		/* command socket descriptor */    FAST char		*pBuf;		/* pointer to session specific buffer */    struct sockaddr_in	passiveAddr;	/* socket address in passive mode */    FAST char		*dirName;	/* directory name place holder */    FAST int		numRead;    int			addrLen = sizeof (passiveAddr);	/* for getpeername */    int			portNum [6];	/* used for "%d,%d,%d,%d,%d,%d" */    u_long 		value;    char 		*pTail;    char 		newPath [MAX_FILENAME_LENGTH];    char 		curDirName [MAX_FILENAME_LENGTH];    char		*pFileName;    FILE		*inStream;    FILE 		*outStream;    char                *upperCommand;    /* convert command to uppercase */    pBuf = &pSlot->buf [0];	/* use session specific buffer area */    sock = pSlot->cmdSock;    if (ftpsShutdownFlag)        {        /* Server halt in progress - send abort message to client. */        ftpdCmdSend (pSlot, sock, 421,                      "Service not available, closing control connection",                     0, 0, 0, 0, 0, 0);        ftpdSessionDelete (pSlot);        return (OK);        }    /* tell the client we're ready to rock'n'roll */#ifdef _WRS_VXWORKS_5_X    if (ftpdCmdSend (pSlot, sock, 220, messages [MSG_SERVER_READY],		(int)vxWorksVersion, 0, 0, 0, 0, 0) == ERROR)#else        if (ftpdCmdSend (pSlot, sock, 220, messages [MSG_SERVER_READY],                         (int)runtimeVersion, 0, 0, 0, 0, 0) == ERROR)#endif /* _WRS_VXWORKS_5_X */	{	ftpdSessionDelete (pSlot);	return (ERROR);	}    FOREVER	{	taskDelay (1);		/* time share among same priority tasks */	/* Check error in writting to the control socket */	if (pSlot->cmdSockError == ERROR)	    {	    ftpdSessionDelete (pSlot);	    return (ERROR);	    }        /*         * Stop processing client requests if a server halt is in progress.         * These tests of the shutdown flag are not protected with the         * mutual exclusion semaphore to prevent unnecessary synchronization         * between client sessions. Because the secondary tasks execute at         * a lower priority than the primary task, the worst case delay         * before ending this session after shutdown has started would only         * allow a single additional command to be performed.         */        if (ftpsShutdownFlag)            break;	/* get a request command */	FOREVER	    {	    taskDelay (1);	/* time share among same priority tasks */	    if ((numRead = read (sock, pBuf, 1)) <= 0)		{                /*                 * The primary server task will close the control connection                 * when a halt is in progress, causing an error on the socket.                 * In this case, ignore the error and exit the command loop                 * to send a termination message to the connected client.                 */                if (ftpsShutdownFlag)                    {                    *pBuf = EOS;                    break;                    }                /*                  * Send a final message if the control socket                  * closed unexpectedly.                 */		if (numRead == 0)		    ftpdCmdSend (pSlot, sock, 221, messages [MSG_NO_GOOD_BYE],		    0, 0, 0, 0, 0, 0);		ftpdSessionDelete (pSlot);		return ERROR;		}	    	    /* Skip the CR in the buffer. */	    if ( *pBuf == '\r' )		continue;	    /* End Of Command delimeter. exit loop and process command */	    if ( *pBuf == '\n' )	    {		*pBuf = EOS;		break;	    }	    pBuf++;		/* Advance to next character to read */	    }	/*  Reset Buffer Pointer before we use it */	pBuf = &pSlot->buf [0];	/* convert the command to upper-case */	for (upperCommand = pBuf; (*upperCommand != ' ') &&	     (*upperCommand != EOS); upperCommand++)	    *upperCommand = toupper (*upperCommand);	ftpdDebugMsg ("read command %s\n", (int)pBuf,0,0,0);        /*         * Send an abort message to the client if a server         * shutdown was started while reading the next command.         */        if (ftpsShutdownFlag)            {            ftpdCmdSend (pSlot, sock, 421,                          "Service not available, closing control connection",                         0, 0, 0, 0, 0, 0);            break;            }	if (strncmp (pBuf, "USER", 4) == 0)	    {	    /* check user name */           /* Actually copy the user name into a buffer and save it */           /* till the password comes in. Name is located one space */           /* character after USER string */           if ( *(pBuf + 4) == '\0' )               pSlot->user[0] = '\0';          /* NOP user for null user */           else               strncpy(pSlot->user, pBuf+5, MAX_LOGIN_NAME_LEN);           pSlot->status &= ~FTPD_USER_OK;	    if (ftpdCmdSend (pSlot, sock, 331, messages [MSG_PASSWORD_REQUIRED],			 0, 0, 0, 0, 0, 0) == ERROR)		{		ftpdSessionDelete (pSlot);		return (ERROR);		}	    continue;	    }	else if (strncmp (pBuf, "PASS", 4) == 0)	    {	    /* check user passwd */           /* Actually check it against earlier supplied user name */	   if ( loginVerifyRtn != (FUNCPTR)NULL )	       {	       if ( (FUNCPTR *)(loginVerifyRtn)(pSlot->user, pBuf+5) != OK )		   {		   if (ftpdCmdSend (pSlot, sock,                                    530, messages [MSG_USER_LOGIN_FAILED],                                     0, 0, 0, 0, 0, 0) == ERROR)		       {		       ftpdSessionDelete (pSlot);		       return (ERROR);		       }		   pSlot->status &= ~FTPD_USER_OK;		   continue;		   }	        }	    pSlot->status |= FTPD_USER_OK;	    if (ftpdCmdSend (pSlot, sock, 230, messages [MSG_USER_LOGGED_IN],			 0, 0, 0, 0, 0, 0) == ERROR)		{		ftpdSessionDelete (pSlot);		return (ERROR);		}	    continue;	    }	else if (strncmp (pBuf, "QUIT", 4) == 0)	    {	    /* sayonara */	    ftpdCmdSend (pSlot, sock, 221, messages [MSG_SEE_YOU_LATER],			 0, 0, 0, 0, 0, 0);	    ftpdSessionDelete (pSlot);	    return OK;	    }	else if (strncmp (pBuf, "HELP", 4) == 0)	    {	    /* send list of supported commands with multiple line response */	    if (ftpdCmdSend (pSlot, sock, FTPD_MULTI_LINE | 214,			messages [MSG_COMMAND_LIST_BEGIN], 0, 0, 0, 0, 0, 0) 			 == ERROR)		{		ftpdSessionDelete (pSlot);		return (ERROR);		}	    if (write (pSlot->cmdSock, ftpdCommandList,				strlen (ftpdCommandList)) <= 0)		{		ftpdSessionDelete (pSlot);		return (ERROR);		}	    /* this signifies the end of the multiple line response */	    if (ftpdCmdSend (pSlot, sock, 214, messages [MSG_COMMAND_LIST_END],			 0, 0, 0, 0, 0, 0) == ERROR)				{		ftpdSessionDelete (pSlot);		return (ERROR);		}	    continue;		/* All is well go wait for the next command */	    }	else if ((pSlot->status & FTPD_USER_OK) == 0)	/* validated yet? */	    {	    /* user is not validated yet.  tell him to log in first */	    if (ftpdCmdSend (pSlot, sock, 530, messages [MSG_USER_PASS_REQ],			 0, 0, 0, 0, 0, 0) == ERROR)				{		ftpdSessionDelete (pSlot);		return (ERROR);		}	    /* do not proceed further until he's legit */	    continue;	    }	if (strncmp (pBuf, "LIST", 4) == 0 ||		 strncmp (pBuf, "NLST", 4) == 0)	    {	    STATUS retVal;	    /* client wants to list out the contents of a directory */	    /* if no directory specified or "." specified as a directory	     * we use the currently active directory name	     */	    if (strlen (pBuf) < 6 || pBuf [5] == '.')	        dirName = &pSlot->curDirName [0];	    else if (pBuf [5] != '/')		{		if (pSlot->curDirName [strlen (pSlot->curDirName) - 1] == '/')		    (void) sprintf (newPath,				    "%s%s", pSlot->curDirName, &pBuf [5]);		else		    (void) sprintf (newPath,				    "%s/%s", pSlot->curDirName, &pBuf [5]);	        dirName = newPath;               }             else               dirName = &pBuf [5];	    ftpdDebugMsg ("LIST %s\n", (int)dirName,0,0,0);	    /* get a new data socket connection for the transmission of	     * the directory listing data	     */	    if (ftpdDataConnGet (pSlot) == ERROR)		{		if (ftpdCmdSend (pSlot, sock,                                  426, messages [MSG_DATA_CONN_ERROR],                                 0, 0, 0, 0, 0, 0) == ERROR)		    		    {		    ftpdSessionDelete (pSlot);		    return (ERROR);		    }		continue;		}	    /* print out the directory contents over the data connection */	    retVal = ftpdDirListGet (pSlot->dataSock, dirName,				     (strncmp (pBuf, "LIST", 4) == 0));	    if (retVal == ERROR)		{		if (ftpdCmdSend (pSlot, sock, 550, messages [MSG_DIR_ERROR],			     0, 0, 0, 0, 0, 0) == ERROR)		    		    {		    ftpdSessionDelete (pSlot);		    return (ERROR);		    }		}	    else		{                if (ftpdCmdSend (pSlot, sock,                                  226, messages [MSG_TRANS_COMPLETE],                                 0, 0, 0, 0, 0, 0) == ERROR)		    {		    ftpdSessionDelete (pSlot);		    return (ERROR);		    }		}	    /* free up the data socket */	    ftpdSockFree (&pSlot->dataSock);	    }	else if (strncmp (pBuf, "RETR", 4) == 0)	    {	    /* retrieve a file */	    /* open the file to be sent to the client */	    if (pBuf [5] != '/')		{		if (pSlot->curDirName [strlen (pSlot->curDirName) - 1] == '/')		    (void) sprintf (newPath,				    "%s%s", pSlot->curDirName, &pBuf [5]);		else		    (void) sprintf (newPath,				    "%s/%s", pSlot->curDirName, &pBuf [5]);		pFileName = newPath;		}	    else	        pFileName = &pBuf [5];	    ftpdDebugMsg ("RETR %s\n", (int)pFileName,0,0,0);	    if ((inStream = fopen (pFileName, "r")) == NULL)	        {		if (ftpdCmdSend (pSlot, sock, 550, messages [MSG_FILE_ERROR],			     (int)(&pBuf[5]), 0, 0, 0, 0, 0) == ERROR)		    		    {		    ftpdSessionDelete (pSlot);		    return (ERROR);		    }		continue;		}	    /* ship it away */	    ftpdDataStreamSend (pSlot, inStream);	    (void) fclose (inStream);	    }	else if (strncmp (pBuf, "STOR", 4) == 0)	    {	    /* store a file */	    /* create a local file */	    if (pBuf [5] != '/')		{		if (pSlot->curDirName [strlen (pSlot->curDirName) - 1] == '/')		    (void) sprintf (newPath,				    "%s%s", pSlot->curDirName, &pBuf [5]);		else		    (void) sprintf (newPath,				    "%s/%s", pSlot->curDirName, &pBuf [5]);		pFileName = newPath;		}	    else	        pFileName = &pBuf [5];	    ftpdDebugMsg ("STOR %s\n", (int)pFileName,0,0,0);	    if ((outStream = fopen (pFileName, "w")) == NULL)	        {		if (ftpdCmdSend (pSlot, sock, 553, messages[MSG_CREATE_ERROR],			(int)(&pBuf[5]), 0, 0, 0, 0, 0) == ERROR)		    {		    ftpdSessionDelete (pSlot);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合色狠狠天天综合色| 国产高清在线精品| 国产欧美精品一区二区色综合| 91丨porny丨最新| 蜜臀av一区二区在线免费观看| 自拍视频在线观看一区二区| 欧美xxxxx牲另类人与| 91久久精品日日躁夜夜躁欧美| 激情六月婷婷久久| 亚洲电影你懂得| 国产精品国产自产拍高清av | 欧美韩日一区二区三区四区| 欧美日韩视频第一区| 北条麻妃一区二区三区| 黄网站免费久久| 欧美aaaaa成人免费观看视频| 亚洲天堂成人在线观看| 欧美成人乱码一区二区三区| 欧美精品色综合| 欧美亚洲丝袜传媒另类| 成人白浆超碰人人人人| 国产在线不卡视频| 秋霞午夜鲁丝一区二区老狼| 亚洲成人激情综合网| 亚洲黄色小视频| 中文字幕av不卡| 国产日韩精品一区| 久久综合色婷婷| 日韩你懂的在线播放| 欧美精品色一区二区三区| 欧美怡红院视频| 色8久久人人97超碰香蕉987| 91在线视频免费91| 成人高清免费观看| 国产91精品在线观看| 国产成人精品免费| 国内精品在线播放| 国产在线国偷精品免费看| 毛片基地黄久久久久久天堂| 日本一区中文字幕| 日本少妇一区二区| 日日夜夜精品免费视频| 五月天一区二区三区| 午夜精品久久久久久不卡8050| 亚洲国产一区二区视频| 一区二区三区不卡在线观看| 中文字幕一区二| 最好看的中文字幕久久| 亚洲视频免费在线观看| 椎名由奈av一区二区三区| 亚洲特黄一级片| 一区二区三区四区视频精品免费 | 国产精品影视网| 风间由美一区二区av101| 成人精品小蝌蚪| 高清av一区二区| 白白色 亚洲乱淫| 欧美在线视频日韩| 欧美巨大另类极品videosbest| 日韩一区二区高清| 久久久久成人黄色影片| 国产精品免费视频网站| 亚洲三级免费观看| 亚洲v日本v欧美v久久精品| 美女任你摸久久| 国产老女人精品毛片久久| 欧美日韩一级二级| 欧美一区二区三区影视| 久久久久久久久久久久电影| 日韩一区有码在线| 五月天婷婷综合| 国产精品一区一区三区| 91理论电影在线观看| 欧美电影一区二区三区| 国产亚洲一区二区三区| 亚洲黄色小视频| 久久97超碰国产精品超碰| 99久久99久久精品免费观看| 欧美日韩电影在线播放| 久久久99免费| 一二三四社区欧美黄| 麻豆国产精品777777在线| www.色综合.com| 欧美一区二区三区在线观看 | 亚洲宅男天堂在线观看无病毒| 日韩精品三区四区| 成人免费毛片a| 7777精品伊人久久久大香线蕉完整版| 欧美精品一区二区在线播放| 亚洲男人的天堂在线aⅴ视频| 麻豆国产精品官网| 欧美艳星brazzers| 欧美—级在线免费片| 日韩—二三区免费观看av| 99在线精品免费| 日韩视频免费观看高清完整版| 最新成人av在线| 国产在线看一区| 91精品国产aⅴ一区二区| 中文字幕视频一区| 国产在线视频一区二区三区| 欧美日韩精品系列| 成人欧美一区二区三区在线播放| 美女久久久精品| 欧美日韩视频在线观看一区二区三区 | 国产精品77777竹菊影视小说| 色悠悠久久综合| 亚洲国产成人私人影院tom| 男男视频亚洲欧美| 欧美精品一卡两卡| 亚洲一区二区三区中文字幕在线| 成人性生交大片免费看在线播放| 91精品久久久久久久久99蜜臂| 亚洲日本电影在线| 亚洲一区二区三区中文字幕在线 | 亚洲成人高清在线| 久久国产婷婷国产香蕉| 欧美挠脚心视频网站| 亚洲国产一区视频| 国产亚洲精品资源在线26u| 国产欧美综合在线观看第十页| 国产精品久久久久久久第一福利 | 男人的天堂亚洲一区| 欧美精品一二三四| 欧美伊人久久大香线蕉综合69| 成人免费毛片片v| 国产精品久久777777| 91一区一区三区| 日韩综合一区二区| 精品国产免费一区二区三区四区| 亚洲第一电影网| 91免费国产在线观看| 亚洲老妇xxxxxx| 韩国一区二区在线观看| 日韩欧美在线综合网| jlzzjlzz欧美大全| 日韩电影免费在线| 国产精品视频一二| 欧美私模裸体表演在线观看| 成人一级黄色片| 2019国产精品| 欧美国产综合色视频| 精品国产乱码久久久久久蜜臀 | 欧美va在线播放| 欧美乱熟臀69xxxxxx| fc2成人免费人成在线观看播放 | 欧美精品丝袜久久久中文字幕| 精品亚洲aⅴ乱码一区二区三区| 中文字幕中文字幕一区| 日韩一级免费一区| 91亚洲精品久久久蜜桃网站| 成人综合在线观看| 免费观看日韩av| 午夜亚洲福利老司机| 亚洲在线观看免费| 亚洲男人天堂av| 亚洲精品一二三四区| 日韩精品一区国产麻豆| av亚洲精华国产精华精华| 久久疯狂做爰流白浆xx| 亚洲免费大片在线观看| 91精品国产91久久久久久最新毛片 | 日韩小视频在线观看专区| 欧美亚洲动漫精品| 国产麻豆91精品| 狠狠色丁香婷婷综合| 99久久国产综合精品色伊 | 国产色产综合产在线视频| 日韩精品一区二区三区在线| 欧美一区二区在线播放| 精品剧情在线观看| 国产亚洲美州欧州综合国| 中文字幕乱码日本亚洲一区二区 | eeuss影院一区二区三区| 日本不卡中文字幕| 国产一区久久久| 人人爽香蕉精品| 秋霞影院一区二区| 日韩成人免费在线| 国产麻豆精品久久一二三| 九九国产精品视频| 色一区在线观看| 久久影院午夜论| 国产精品一区久久久久| 亚洲第一成年网| 久久九九99视频| 欧美日韩视频在线一区二区 | 国产成人免费在线视频| 亚洲女爱视频在线| 26uuu亚洲| 欧美精品成人一区二区三区四区| 国产91富婆露脸刺激对白| 五月天激情综合网| 国产精品美女一区二区在线观看| 欧美亚洲禁片免费| 不卡在线观看av| 韩国女主播成人在线观看| 亚洲.国产.中文慕字在线| 国产精品伦一区| 亚洲精品在线三区|