if (PR_WOULD_BLOCK_ERROR == code)
if (PR_WOULD_BLOCK_ERROR == code) { LOG(("nsSocketTransport: PR_Write() failed with PR_WOULD_BLOCK_ERROR\n"));
    NS_IMETHOD Write(const char *aBuf, PRUint32 aCount, PRUint32 *aBytesWritten) {        NS_PRECONDITION(mSocketFD, "null socket fd");        PRInt32 result = PR_Write(mSocketFD, aBuf, aCount);        LOG(("nsSocketTransport: PR_Write(count=%u) returned %d\n", aCount, result));        nsresult rv = NS_OK;        if (result < 0) {            PRErrorCode code = PR_GetError();            if (PR_WOULD_BLOCK_ERROR == code)                rv = NS_BASE_STREAM_WOULD_BLOCK;            else {                LOG(("nsSocketTransport: PR_Write() failed [error=%x, os_error=%x]\n",                    code, PR_GetOSError()));                rv = NS_ERROR_FAILURE;            }            *aBytesWritten = 0;        }        else {            *aBytesWritten = result;            mBytesWritten += result;        }        return rv;    }