rv = NS_ERROR_FAILURE; } } }  PR_LOG(gSocketLog, PR_LOG_DEBUG, ("nsWriteToSocket [fd=%x].  rv = %x. Buffer space = %d.  Bytes written =%d\n", fd, rv, count, *writeCount));  return rv;
return rv;
nsWriteToSocket(nsIInputStream* in,                void* closure,                const char* fromRawSegment,                PRUint32 toOffset,                PRUint32 count,                PRUint32 *writeCount){  nsresult rv = NS_OK;  PRInt32 len;  PRFileDesc* fd = (PRFileDesc*)closure;  *writeCount = 0;  if (count > 0) {    len = PR_Write(fd, fromRawSegment, count);    if (len > 0) {      *writeCount = (PRUint32)len;    }    //    // Error...    //    else {      PRErrorCode code = PR_GetError();      if (PR_WOULD_BLOCK_ERROR == code) {        rv = NS_BASE_STREAM_WOULD_BLOCK;      }       else {        PR_LOG(gSocketLog, PR_LOG_ERROR,                ("PR_Write() failed. PRErrorCode = %x\n", code));        // XXX: What should this error code be?        rv = NS_ERROR_FAILURE;      }    }  }  PR_LOG(gSocketLog, PR_LOG_DEBUG,          ("nsWriteToSocket [fd=%x].  rv = %x. Buffer space = %d.  Bytes written =%d\n",          fd, rv, count, *writeCount));  return rv;}