for (index=0; index < iov_size; index++) { rv = _PR_MD_SEND(fd, iov[index].iov_base, iov[index].iov_len, 0, timeout); if (rv > 0) sent += rv; if ( rv != iov[index].iov_len ) { if (rv < 0) { if (fd->secret->nonblocking && (PR_GetError() == PR_WOULD_BLOCK_ERROR) && (sent > 0)) { return sent; } else { return -1; } }  PR_ASSERT(fd->secret->nonblocking); return sent;
if (!fd->secret->nonblocking) { for (index=0; index<iov_size; index++) { amount += iov[index].iov_len;
_PR_MD_WRITEV(PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size, PRIntervalTime timeout){    int index;    int sent = 0;    int rv;    for (index=0; index < iov_size; index++)     {        rv = _PR_MD_SEND(fd, iov[index].iov_base, iov[index].iov_len, 0, timeout);        if (rv > 0)             sent += rv;        if ( rv != iov[index].iov_len )         {            if (rv < 0)            {                if (fd->secret->nonblocking                    && (PR_GetError() == PR_WOULD_BLOCK_ERROR)                    && (sent > 0))                {                    return sent;                }                else                {                    return -1;                }            }            /* Only a nonblocking socket can have partial sends */            PR_ASSERT(fd->secret->nonblocking);            return sent;        }    }    return sent;}