nsresult rv;
nsresult rv = NS_ERROR_FAILURE;
nsresult TestConnection::WriteBuffer(void){  nsresult rv;  char *buffer;  PRInt32 size;  PRUint32 bytesWritten;  if (mBufferChar == 'z') {    mBufferChar = 'a';  } else {    mBufferChar++;  }  if (gVerbose)    printf("\n+++ Request is: %c.  Context = %p\n", mBufferChar, (void*)mTransport);  // Create and fill a test buffer of data...  buffer = (char*)PR_Malloc(mBufferLength + 4);  if (buffer) {    for (size=0; size<mBufferLength-2; size++) {      buffer[size] = mBufferChar;    }    buffer[size++] = '\r';    buffer[size++] = '\n';    buffer[size]   = 0;    //    // Async case...    //    if (mStream) {      rv = mOut->Write(buffer, size, &bytesWritten);      // Write the buffer to the server...      if (NS_SUCCEEDED(rv)) {          rv = NS_AsyncWriteFromStream(                  getter_AddRefs(mWriteRequest),                  mTransport, mStream, 0, bytesWritten, 0,                  nsnull, mTransport);      }       // Wait for the write to complete...      if (NS_FAILED(rv)) {        printf("Error: AsyncWrite failed...");      }    }     //    // Synchronous case...    //    else if (mOutStream) {      rv = mOutStream->Write(buffer, size, &bytesWritten);      NS_ASSERTION((PRUint32)size == bytesWritten, "Not enough was written...");    }    PR_Free(buffer);  } else {    rv = NS_ERROR_OUT_OF_MEMORY;  }  return rv;}