From: <ta...@us...> - 2003-04-11 07:21:46
|
Update of /cvsroot/csmaild/csmaild/src/Imap In directory sc8-pr-cvs1:/tmp/cvs-serv15772/src/Imap Modified Files: Connection.cs Imap.csproj Server.cs Log Message: Index: Connection.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Connection.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Connection.cs 11 Apr 2003 01:29:25 -0000 1.2 --- Connection.cs 11 Apr 2003 07:21:41 -0000 1.3 *************** *** 37,40 **** --- 37,48 ---- } + public Connection Connection + { + get + { + return mConnection; + } + } + /// <summary> /// Creates a new ImapConnection object, starts in NotAuthenticated state *************** *** 43,47 **** public ImapConnection(Connection con) { ! mConnection = mConnection; mState = ImapConnectionState.NotAuthenticated; } --- 51,55 ---- public ImapConnection(Connection con) { ! mConnection = con; mState = ImapConnectionState.NotAuthenticated; } Index: Imap.csproj =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Imap.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Imap.csproj 11 Apr 2003 01:29:25 -0000 1.3 --- Imap.csproj 11 Apr 2003 07:21:42 -0000 1.4 *************** *** 93,96 **** --- 93,121 ---- /> <File + RelPath = "Commands\AppendCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\AuthenticateCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\CapabilityCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\CheckCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\CloseCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Commands\CommandPart.cs" SubType = "Code" *************** *** 98,102 **** --- 123,227 ---- /> <File + RelPath = "Commands\CopyCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\CreateCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\DeleteCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\ExamineCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\ExpungeCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\FetchCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Commands\ImapCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\ListCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\LoginCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\LogoutCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\LsubCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\NoopCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\RenameCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\SearchCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\SelectCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\StarttlsCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\StatusCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\StoreCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\SubscribeCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\UidCommand.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "Commands\UnsubscribeCommand.cs" SubType = "Code" BuildAction = "Compile" Index: Server.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Server.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Server.cs 11 Apr 2003 01:29:25 -0000 1.3 --- Server.cs 11 Apr 2003 07:21:42 -0000 1.4 *************** *** 1,3 **** --- 1,4 ---- using System; + using Imap.Commands; using Imap.NetworkManager; using System.Collections; *************** *** 12,15 **** --- 13,17 ---- private NetworkManager.NetworkManager mNetwork; private Hashtable mImapConnections = new Hashtable(); + private Hashtable mImapCommands = new Hashtable(); public Server() *************** *** 17,20 **** --- 19,50 ---- mNetwork = new NetworkManager.NetworkManager(); mImapConnections = new Hashtable(); + + #region Register handlers + mImapCommands.Add("APPEND", new AppendCommand()); + mImapCommands.Add("AUTHENTICATE", new AuthenticateCommand()); + mImapCommands.Add("CAPABILITY", new CapabilityCommand()); + mImapCommands.Add("CHECK", new CheckCommand()); + mImapCommands.Add("CLOSE", new CloseCommand()); + mImapCommands.Add("COPY", new CopyCommand()); + mImapCommands.Add("CREATE", new CreateCommand()); + mImapCommands.Add("DELETE", new DeleteCommand()); + mImapCommands.Add("EXAMINE", new ExamineCommand()); + mImapCommands.Add("EXPUNGE", new ExpungeCommand()); + mImapCommands.Add("FETCH", new FetchCommand()); + mImapCommands.Add("LIST", new ListCommand()); + mImapCommands.Add("LOGIN", new LoginCommand()); + mImapCommands.Add("LOGOUT", new LogoutCommand()); + mImapCommands.Add("LSUB", new LsubCommand()); + mImapCommands.Add("NOOP", new NoopCommand()); + mImapCommands.Add("RENAME", new RenameCommand()); + mImapCommands.Add("SEARCH", new SearchCommand()); + mImapCommands.Add("SELECT", new SelectCommand()); + mImapCommands.Add("STARTTLS", new StarttlsCommand()); + mImapCommands.Add("STATUS", new StatusCommand()); + mImapCommands.Add("STORE", new StoreCommand()); + mImapCommands.Add("SUBSCRIBE", new SubscribeCommand()); + mImapCommands.Add("UID", new UidCommand()); + mImapCommands.Add("UNSUBSCRIBE", new UnsubscribeCommand()); + #endregion } *************** *** 56,59 **** --- 86,96 ---- string tag = line.Substring(0, idxTag); string cmd = line.Substring(idxTag+1, idxCommand-idxTag-1); + string args = line.Substring(idxCommand+1); + + ImapCommand command = (ImapCommand)mImapCommands[cmd]; + if(command != null) + command.Process((ImapConnection)mImapConnections[con], tag); + else + ((ImapConnection)mImapConnections[con]).Connection.WriteLine(tag + " BAD"); con.ReadLine(); |