email/imap4mtm/imapsession/src/cimapatomparser.cpp
changeset 72 6f657153cbc5
parent 0 72b543305e3a
equal deleted inserted replaced
70:a15d9966050f 72:6f657153cbc5
   123 	}
   123 	}
   124 
   124 
   125 // Add to the parsed buffer
   125 // Add to the parsed buffer
   126 void CImapAtomParser::BufferAppendL(const TChar aChar)
   126 void CImapAtomParser::BufferAppendL(const TChar aChar)
   127 	{
   127 	{
       
   128     ++iAttachmentLength;
   128 	// Check for internal programming error
   129 	// Check for internal programming error
   129 	__ASSERT_DEBUG(iBuffer != NULL, TImapServerPanic::ImapPanic(TImapServerPanic::EAtomParserBufferIsNull));
   130 	__ASSERT_DEBUG(iBuffer != NULL, TImapServerPanic::ImapPanic(TImapServerPanic::EAtomParserBufferIsNull));
   130 	
   131 	
   131 	// Does buffer need extending?
   132 	// Does buffer need extending?
   132 	if (iBuffer->Length()==iBufferSize)
   133 	if (iBuffer->Length()==iBufferSize)
   335 					case '\r':
   336 					case '\r':
   336 						// Whitespace: end of atom
   337 						// Whitespace: end of atom
   337 						// Note that the CRLF will already have been stripped out by CImapSession
   338 						// Note that the CRLF will already have been stripped out by CImapSession
   338 						// so we are treating a CR on its own as whitespace
   339 						// so we are treating a CR on its own as whitespace
   339 						{
   340 						{
       
   341 						// if white space is there in the attched file's name,it will add to the buffer.
       
   342 						if( iAttachmentLength < iLiteralLength)
       
   343 						    {
       
   344                             BufferAppendL(octet);
       
   345                             break;
       
   346 						    }
       
   347 						    
   340 						AddAtomL();
   348 						AddAtomL();
   341 					
   349 					
   342 						// Either go back to looking for an atom, or a LF
   350 						// Either go back to looking for an atom, or a LF
   343 						//iParserState=(octet=='\r')?EStateWaitLF:EStateAtomWait;
   351 						//iParserState=(octet=='\r')?EStateWaitLF:EStateAtomWait;
   344 						iParserState = EStateAtomWait;
   352 						iParserState = EStateAtomWait;
   443 			break;
   451 			break;
   444 		case EStateLiteralSkip:
   452 		case EStateLiteralSkip:
   445 			// Skipping...
   453 			// Skipping...
   446 			if (--iLiteralSkip==0)
   454 			if (--iLiteralSkip==0)
   447 				{
   455 				{
       
   456                     iAttachmentLength = 0;
   448 				// Is literal 0 bytes long?
   457 				// Is literal 0 bytes long?
   449 				if (iLiteralLength==0)
   458 				if (iLiteralLength==0)
   450 					{
   459 					{
   451 					// Nothing to follow
   460 					// Nothing to follow
   452 					iParserState=EStateAtomWait;
   461 					iParserState=EStateAtomWait;