return ((NS_OK == errorCode) && (bytesWritten == length));
if (NS_FAILED(errorCode) || (bytesWritten != length)) { return -1; } return 1;
int stub_put_block(NET_StreamClass *stream, const char *buffer, int32 length){    PRInt32 bytesWritten;    nsresult errorCode;    nsConnectionInfo *pConn = GetConnectionInfoFromStream(stream);    TRACEMSG(("+++ stream put_block.  Length = %d\n", length));    /*     * XXX:  Sometimes put_block(...) will be called without having      *       called is_write_ready(...) first.  One case is when a stream     *       is interrupted...  In this case, Netlib will call put_block(...)     *       with the string "Transfer Interrupted!"     */    errorCode = pConn->pNetStream->Write(buffer, 0, length, &bytesWritten);    /* Abort the connection... */    if (NS_BASE_STREAM_EOF == errorCode) {        return -1;    }    if (pConn->pConsumer && (0 < bytesWritten)) {        errorCode = pConn->pConsumer->OnDataAvailable(pConn->pURL, pConn->pNetStream, bytesWritten);    }    return ((NS_OK == errorCode) && (bytesWritten == length));}