From aecef380229a31b1a04005f1eb908c90babcbd22 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Sat, 24 Mar 2001 01:06:53 +0000 Subject: [PATCH] fix it so we won't try to send "ARTICLE <" to the nntp server. on quit, we sometimes get into a state where we try to send that to the server. if I detect that state, I return error but I don't send the bogus data over the wire. sr=bienvenu related to bugs #57659 and #72317 --- mailnews/news/src/nsNNTPProtocol.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mailnews/news/src/nsNNTPProtocol.cpp b/mailnews/news/src/nsNNTPProtocol.cpp index 782ae0ed9c0..cc2aa7ad258 100644 --- a/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mailnews/news/src/nsNNTPProtocol.cpp @@ -2036,6 +2036,9 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommand(nsIURI * url) } else /* article or cancel */ { + NS_ASSERTION(m_path, "no m_path, see bugs #57659 and #72317"); + if (!m_path) return -1; + if (m_typeWanted == CANCEL_WANTED) { NET_SACopy(&command, "HEAD "); } @@ -2043,10 +2046,10 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommand(nsIURI * url) NS_ASSERTION(m_typeWanted == ARTICLE_WANTED, "not cancel, and not article"); NET_SACopy(&command, "ARTICLE "); } - if (m_path && *m_path != '<') + + if (*m_path != '<') NET_SACat(&command,"<"); - NS_ASSERTION(m_path, "no path"); NET_SACat(&command, m_path); if (PL_strchr(command+8, '>')==0) @@ -2064,7 +2067,6 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommand(nsIURI * url) m_nextStateAfterResponse = SEND_FIRST_NNTP_COMMAND_RESPONSE; SetFlag(NNTP_PAUSE_FOR_READ); return(status); - } /* sent first command */