又出问题了。救命啊!
现在我的程序终于能收qp编码的邮件了。
可是新问题出来了,不知道为什么不能删除一个数组。只能收到第一封信。
进行到delete []sbuf时出错
DAMAGE: after normal block (#68) at 0x00650089
附带源码如下,救命啊!!!!!
BOOL CPop3Connection::ReadReturnResponse(CPop3Message& message, DWORD dwSize)
{
//Must be connected to perform a "RETR"
ASSERT(m_bConnected);
//We need a flexible sized receiver buffer here
int nSize = dwSize + 100;
char* sBuf = new char[nSize];
if (!ReadResponse(sBuf, nSize, "\r\n\r\n"))
{
TRACE(_T("Error retrieving the RETR response"));
return FALSE;
}
//determine if the response is an error
if (strnicmp(sBuf,"+OK", 3) != 0)
{
SetLastError(WSAEPROTONOSUPPORT);
TRACE(_T("POP3 server did not respond correctly to the RETR response\n"));
delete []sBuf;
return FALSE;
}
else
{
//remove the first line which contains the +OK from the message
char* pszFirst = GetFirstCharInResponse(sBuf);
VERIFY(pszFirst);
//transfer the message contents to the message class
int nMessageSize = sBuf - pszFirst + strlen(sBuf);
message.m_pszMessage = new char[nMessageSize + 1];
memcpy(message.m_pszMessage, pszFirst, nMessageSize);
message.m_pszMessage[nMessageSize] = '\0';
}
delete []sBuf;
return TRUE;
..........