NS_ASSERTION(!mTestAsyncOpen || mAsyncOpenCompleted, "AsyncOpen failed");
TestConnection::OnDataAvailable(nsIChannel* channel, nsISupports* context,                                nsIInputStream *aIStream,                                 PRUint32 aSourceOffset,                                PRUint32 aLength){  char buf[1025];  PRUint32 amt;  printf("\n+++ TestConnection::OnDavaAvailable +++."         "\tContext = %p length = %d\n",          context, aLength);  do {    aIStream->Read(buf, 1024, &amt);    mBytesRead += amt;    buf[amt] = '\0';    puts(buf);  } while (amt != 0);  if (mBufferLength == mBytesRead) {    mBytesRead = 0;    WriteBuffer();  }  return NS_OK;}