if (TestFlag(IMAP_WAITING_FOR_DATA)) {
NS_IMETHODIMP nsImapProtocol::OnDataAvailable(nsIRequest *request, nsISupports *ctxt, nsIInputStream *aIStream, PRUint32 aSourceOffset, PRUint32 aLength){    nsresult res = NS_OK;    if(NS_SUCCEEDED(res) && aLength > 0)    {    // make sure m_inputStream is set to the right input stream...    if (!m_inputStream)      m_inputStream = dont_QueryInterface(aIStream);	if (TestFlag(IMAP_WAITING_FOR_DATA))	{        // if we received data, we need to signal the data available monitor...	    // Read next line from input will actually read the data out of the stream		ClearFlag(IMAP_WAITING_FOR_DATA); // we are no longer waiting for data		PR_EnterMonitor(m_dataAvailableMonitor);			PR_Notify(m_dataAvailableMonitor);		PR_ExitMonitor(m_dataAvailableMonitor);	}  }  return res;}