if (len >= 0) { *readCount = (PRUint32)len; info -> bEOF = (0 == len); }    else { PRErrorCode code = PR_GetError   ();
LOG(("nsSocketTransport: nsReadFromSocket [fd=%x]. rv = %x. Buffer space = %d. Bytes read =%d\n", info->fd, rv, count, *readCount));
nsReadFromSocket(nsIOutputStream* out,                 void* closure,                 char* toRawSegment,                 PRUint32 offset,                 PRUint32 count,                 PRUint32 *readCount){  nsresult rv = NS_OK;  PRInt32 len;  nsReadFromSocketClosure *info = (nsReadFromSocketClosure*)closure;  info->bEOF = PR_FALSE;  *readCount = 0;  if (count > 0)  {        len = PR_Read (info -> fd, toRawSegment, count);    if (len >= 0)    {      *readCount = (PRUint32)len;      info -> bEOF = (0 == len);    }     //    // Error...    //    else    {        PRErrorCode code = PR_GetError   ();    if (PR_WOULD_BLOCK_ERROR == code)    {        rv = NS_BASE_STREAM_WOULD_BLOCK;    }    else    {        PRInt32 osCode = PR_GetOSError ();        PR_LOG (gSocketLog, PR_LOG_ERROR, ("PR_Read() failed. PRErrorCode = %x, os_error=%d\n", code, osCode));        info -> bEOF = PR_TRUE;        // XXX: What should this error code be?        rv = NS_ERROR_FAILURE;      }    }  }  PR_LOG(gSocketLog, PR_LOG_DEBUG,          ("nsReadFromSocket [fd=%x].  rv = %x. Buffer space = %d.  Bytes read =%d\n",          info->fd, rv, count, *readCount));  return rv;}