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

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

?? ftpdlib.c

?? vxworks的完整的源代碼
?? 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一区二区三区免费野_久草精品视频
久久久国产精品麻豆| 中文字幕精品一区二区三区精品 | 欧美精品一区二区三| 国产亚洲一区二区在线观看| 亚洲一区二三区| 风间由美一区二区av101| 欧美久久高跟鞋激| 国产精品大尺度| 国产一区二区网址| 日韩三级中文字幕| 亚洲午夜免费视频| 91在线观看免费视频| wwww国产精品欧美| 麻豆精品在线观看| 91麻豆精品91久久久久久清纯 | 欧美色图第一页| 国产精品沙发午睡系列990531| 另类小说综合欧美亚洲| 欧美久久高跟鞋激| 亚洲国产成人高清精品| 色美美综合视频| 亚洲男人都懂的| 99re热这里只有精品免费视频| 久久久99久久| 国产一区二区美女| www一区二区| 精品亚洲成a人| 精品伦理精品一区| 国产自产2019最新不卡| 欧美一级国产精品| 麻豆精品在线视频| 欧美大片在线观看一区二区| 日韩电影在线免费| 日韩精品一区国产麻豆| 美女mm1313爽爽久久久蜜臀| 日韩精品一区二区在线观看| 免费看精品久久片| 久久伊人蜜桃av一区二区| 国产成人在线视频网站| 国产精品丝袜在线| 国产成人精品一区二区三区四区| 国产午夜精品一区二区三区嫩草| 国产一区二区三区不卡在线观看| 国产亚洲精久久久久久| 国产河南妇女毛片精品久久久| 久久久久久免费网| 成人福利视频在线| 亚洲激情第一区| 91精品国产一区二区三区| 久久国产尿小便嘘嘘尿| 国产欧美一区二区三区鸳鸯浴| 成人午夜视频免费看| 亚洲乱码国产乱码精品精的特点 | 国产91精品入口| 国产精品毛片大码女人| 欧美在线免费观看视频| 日韩电影免费一区| 欧美极品xxx| 欧美中文字幕一区二区三区| 午夜精品免费在线观看| 精品三级av在线| www.欧美.com| 日韩avvvv在线播放| 国产欧美va欧美不卡在线| 99v久久综合狠狠综合久久| 午夜精品免费在线| 国产婷婷色一区二区三区| 欧美无乱码久久久免费午夜一区| 精品在线观看视频| 亚洲精品写真福利| 久久精品视频一区二区三区| 91福利精品视频| 国内精品伊人久久久久av影院| 17c精品麻豆一区二区免费| 欧美高清dvd| 成人av资源站| 激情国产一区二区 | 欧美日韩一区二区在线观看 | 91在线视频播放地址| 免费一级欧美片在线观看| 综合色中文字幕| 日韩欧美在线网站| 91麻豆精东视频| 国产一区二区三区综合| 亚洲国产精品一区二区www在线| 久久九九国产精品| 日韩一级在线观看| 在线观看欧美精品| av在线免费不卡| 国产成人精品影视| 久久er99热精品一区二区| 亚洲午夜私人影院| 亚洲精品欧美专区| 日本一区二区高清| 久久久久久久久久看片| 91精品国产欧美一区二区成人| 一本大道久久精品懂色aⅴ| 国产福利一区在线| 精品一区二区三区不卡| 日韩精品一二区| 丝袜亚洲另类欧美综合| 一级精品视频在线观看宜春院| 欧美国产日韩精品免费观看| 亚洲精品在线电影| 日韩美女在线视频| 制服丝袜亚洲播放| 欧美丰满一区二区免费视频| 色妹子一区二区| 91啦中文在线观看| 91视频免费播放| 色哟哟在线观看一区二区三区| av成人动漫在线观看| 成人丝袜18视频在线观看| 国产成人午夜99999| 国产99一区视频免费| 国产黑丝在线一区二区三区| 国产精品资源在线看| 国产乱码精品一品二品| 国产一区二区三区日韩| 国产尤物一区二区在线| 成人在线综合网站| 成人免费毛片嘿嘿连载视频| 成人污视频在线观看| 99麻豆久久久国产精品免费| www.久久精品| 欧美性受xxxx| 欧美高清视频在线高清观看mv色露露十八 | 国产视频一区在线观看| 中文字幕欧美激情| 亚洲综合男人的天堂| 日本va欧美va精品发布| 激情欧美一区二区三区在线观看| 国产精品 日产精品 欧美精品| 成年人午夜久久久| 欧美日韩一区二区三区在线| 欧美一级欧美三级| 久久天天做天天爱综合色| 国产精品福利一区| 亚洲国产综合色| 精品一区二区三区久久| 91在线观看成人| 91精品蜜臀在线一区尤物| 日韩精品一区二区三区在线播放| 久久精品亚洲麻豆av一区二区| 亚洲美女少妇撒尿| 日韩不卡在线观看日韩不卡视频| 国产一区中文字幕| 欧美系列在线观看| 国产亚洲欧美在线| 亚洲va天堂va国产va久| 国产美女视频一区| 色婷婷综合视频在线观看| 欧美一二三区在线| 亚洲丝袜另类动漫二区| 裸体一区二区三区| 91亚洲精品久久久蜜桃网站| 欧美一区二区日韩| 亚洲日本一区二区| 麻豆91在线观看| 91久久久免费一区二区| www成人在线观看| 亚洲bt欧美bt精品| 波多野结衣中文字幕一区二区三区| 欧美男女性生活在线直播观看| 国产女主播在线一区二区| 婷婷成人综合网| 色呦呦国产精品| 中文字幕不卡在线播放| 蜜桃视频一区二区三区| 欧美亚洲国产bt| 中文字幕欧美国产| 国产一区二区三区在线看麻豆| 欧美日韩大陆在线| 一区二区三区资源| 国产成人鲁色资源国产91色综 | 99精品桃花视频在线观看| 欧美一区二区三区免费大片| 亚洲精品中文字幕在线观看| 国产精品资源在线看| 精品国产乱码久久久久久牛牛| 水蜜桃久久夜色精品一区的特点| av欧美精品.com| 国产精品久久久久天堂| 国产精品一区二区三区网站| 欧美精品在线观看一区二区| 亚洲一区欧美一区| 91福利国产精品| 一区二区三区四区五区视频在线观看| 国产福利一区在线| 国产欧美日韩视频在线观看| 国模娜娜一区二区三区| 日韩一区二区三区观看| 日韩成人精品视频| 91精品国产综合久久婷婷香蕉 | 日韩午夜在线播放| 手机精品视频在线观看| 7777精品伊人久久久大香线蕉超级流畅 | 成人黄色片在线观看| 国产欧美一区二区精品仙草咪| 麻豆精品视频在线|