зеркало из https://github.com/mozilla/pjs.git
cleanup imap parser syntax error line handling a little, 312572, r/sr=bienvenu
This commit is contained in:
Родитель
ea2955ba39
Коммит
ad2a41ccbc
|
@ -53,7 +53,6 @@ fLineOfTokens(nsnull),
|
|||
fStartOfLineOfTokens(nsnull),
|
||||
fCurrentTokenPlaceHolder(nsnull),
|
||||
fAtEndOfLine(PR_FALSE),
|
||||
fSyntaxErrorLine(nsnull),
|
||||
fSyntaxError(PR_FALSE),
|
||||
fDisconnected(PR_FALSE)
|
||||
{
|
||||
|
@ -63,7 +62,6 @@ nsIMAPGenericParser::~nsIMAPGenericParser()
|
|||
{
|
||||
PR_FREEIF( fCurrentLine );
|
||||
PR_FREEIF( fStartOfLineOfTokens);
|
||||
PR_FREEIF( fSyntaxErrorLine );
|
||||
}
|
||||
|
||||
void nsIMAPGenericParser::HandleMemoryFailure()
|
||||
|
@ -88,22 +86,9 @@ PRBool nsIMAPGenericParser::LastCommandSuccessful()
|
|||
void nsIMAPGenericParser::SetSyntaxError(PRBool error)
|
||||
{
|
||||
fSyntaxError = error;
|
||||
PR_FREEIF( fSyntaxErrorLine );
|
||||
if (error)
|
||||
{
|
||||
NS_ASSERTION(PR_FALSE, "syntax error in generic parser");
|
||||
fSyntaxErrorLine = PL_strdup(fCurrentLine);
|
||||
}
|
||||
else
|
||||
fSyntaxErrorLine = NULL;
|
||||
NS_ASSERTION(!error, "syntax error in generic parser");
|
||||
}
|
||||
|
||||
char *nsIMAPGenericParser::CreateSyntaxErrorLine()
|
||||
{
|
||||
return PL_strdup(fSyntaxErrorLine);
|
||||
}
|
||||
|
||||
|
||||
PRBool nsIMAPGenericParser::SyntaxError()
|
||||
{
|
||||
return fSyntaxError;
|
||||
|
|
|
@ -66,8 +66,6 @@ public:
|
|||
PRBool Connected();
|
||||
virtual void SetConnected(PRBool error);
|
||||
|
||||
char *CreateSyntaxErrorLine();
|
||||
|
||||
protected:
|
||||
|
||||
// This is a pure virtual member which must be overridden in the derived class
|
||||
|
@ -103,8 +101,6 @@ protected:
|
|||
char *fStartOfLineOfTokens;
|
||||
char *fCurrentTokenPlaceHolder;
|
||||
PRBool fAtEndOfLine;
|
||||
|
||||
char *fSyntaxErrorLine;
|
||||
PRBool fSyntaxError;
|
||||
private:
|
||||
PRBool fDisconnected;
|
||||
|
|
|
@ -2928,17 +2928,17 @@ void nsImapServerResponseParser::SetSyntaxError(PRBool error)
|
|||
nsIMAPGenericParser::SetSyntaxError(error);
|
||||
if (error)
|
||||
{
|
||||
if (!fSyntaxErrorLine)
|
||||
if (!fCurrentLine)
|
||||
{
|
||||
HandleMemoryFailure();
|
||||
fServerConnection.Log("PARSER", ("Internal Syntax Error: <no line>"), nsnull);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!nsCRT::strcmp(fSyntaxErrorLine, CRLF))
|
||||
if (!nsCRT::strcmp(fCurrentLine, CRLF))
|
||||
fServerConnection.Log("PARSER", "Internal Syntax Error: <CRLF>", nsnull);
|
||||
else
|
||||
fServerConnection.Log("PARSER", "Internal Syntax Error: %s", fSyntaxErrorLine);
|
||||
fServerConnection.Log("PARSER", "Internal Syntax Error: %s", fCurrentLine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче