Skip to content

Commit

Permalink
Merge pull request #1 from manuel11g/master
Browse files Browse the repository at this point in the history
Bug to fix large attachment issue
  • Loading branch information
rohitjoshi committed Dec 20, 2015
2 parents 6af11e7 + f096f18 commit daf4cff
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions ImapLibrary/ImapBase.cs
Expand Up @@ -697,17 +697,21 @@ protected ImapResponseEnum SendAndReceiveByNumLines(string command, ref ArrayLis
/// <param name="sBuffer"></param>
/// <param name="nSize"></param>
/// <returns></returns>
protected int ReceiveBuffer (ref string sBuffer, int nSize)
{
int nRead = -1;
char [] cBuff = new Char[nSize+1];
//cBuff[nSize+1] = '\0';
nRead = m_oRdStrm.Read(cBuff, 0, nSize);
string sTmp = new String(cBuff);
sBuffer = sTmp;
Log (LogTypeEnum.IMAP, sBuffer);
return nRead;
}
protected int ReceiveBuffer(ref string sBuffer, int nSize)
{
int nRead = -1;
int tSize = 0;
char[] cBuff = new Char[nSize + 1];
while (tSize < nSize)
{
nRead = m_oRdStrm.Read(cBuff, 0, nSize - tSize);
string sTmp = new String(cBuff);
sBuffer += sTmp.Substring(0, nRead);
tSize = tSize + nRead;
}
Log(LogTypeEnum.IMAP, sBuffer);
return nRead;
}



Expand Down

0 comments on commit daf4cff

Please sign in to comment.