if(dest != null && !dest.isMulticastAddress()) break; num_bytes_received+=(long)Math.max(msg.getLength(), 24); if(num_bytes_received >= max_bytes) { if(trace) { log.trace(new StringBuffer("max_bytes has been reached (").append(max_bytes). append(", bytes received=").append(num_bytes_received).append("): triggers stable msg"));
if(dest == null || dest.isMulticastAddress()) { num_bytes_received+=(long)Math.max(msg.getLength(), 24); if(num_bytes_received >= max_bytes) { if(trace) { log.trace(new StringBuffer("max_bytes has been reached (").append(max_bytes). append(", bytes received=").append(num_bytes_received).append("): triggers stable msg")); } num_bytes_received=0;  passDown(new Event(Event.GET_DIGEST_STABLE));
    public void up(Event evt) {        Message msg;        StableHeader hdr;        int type=evt.getType();        switch(type) {        case Event.MSG:            msg=(Message)evt.getArg();            // only if message counting is enabled, and only for multicast messages            // fixes http://jira.jboss.com/jira/browse/JGRP-233            if(max_bytes > 0) {                Address dest=msg.getDest();                if(dest != null && !dest.isMulticastAddress())                    break;                num_bytes_received+=(long)Math.max(msg.getLength(), 24);                if(num_bytes_received >= max_bytes) {                    if(trace) {                        log.trace(new StringBuffer("max_bytes has been reached (").append(max_bytes).                                  append(", bytes received=").append(num_bytes_received).append("): triggers stable msg"));                    }                    num_bytes_received=0;                    // asks the NAKACK protocol for the current digest, reply event is GET_DIGEST_STABLE_OK (arg=digest)                    passDown(new Event(Event.GET_DIGEST_STABLE));                }            }            hdr=(StableHeader)msg.removeHeader(name);            if(hdr == null)                break;            switch(hdr.type) {            case StableHeader.STABLE_GOSSIP:                handleStableMessage(msg.getSrc(), hdr.stableDigest);                break;            case StableHeader.STABILITY:                handleStabilityMessage(hdr.stableDigest, msg.getSrc());                break;            default:                if(log.isErrorEnabled()) log.error("StableHeader type " + hdr.type + " not known");            }            return;  // don't pass STABLE or STABILITY messages up the stack        case Event.GET_DIGEST_STABLE_OK:            Digest d=(Digest)evt.getArg();            synchronized(latest_local_digest) {                latest_local_digest.replace(d);            }            if(trace)                log.trace("setting latest_local_digest from NAKACK: " + d.printHighSeqnos());            sendStableMessage(d);            break;        case Event.VIEW_CHANGE:            View view=(View)evt.getArg();            handleViewChange(view);            break;        case Event.SET_LOCAL_ADDRESS:            local_addr=(Address)evt.getArg();            break;        }        passUp(evt);    }