Skip to content

Commit

Permalink
newer mina don't have EMPTY_BUFFER.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robey Pointer committed Sep 23, 2009
1 parent efcf729 commit 5efb5c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/scala/net/lag/naggati/State.scala
Expand Up @@ -22,6 +22,10 @@ import org.apache.mina.core.session.IoSession
import org.apache.mina.filter.codec.ProtocolDecoderOutput


object State {
val EMPTY_BUFFER = IoBuffer.wrap(new Array[Byte](0))
}

/**
* Container for state associated with a Mina `IoSession`,
* including the current incoming data buffer and arbitrary key/value data
Expand All @@ -33,7 +37,7 @@ class State protected[naggati](firstStep: Step, val session: IoSession, val out:
/**
* Current (mina) buffer being processed.
*/
var buffer: IoBuffer = IoBuffer.EMPTY_BUFFER
var buffer: IoBuffer = State.EMPTY_BUFFER

// track whether we allocated this IoBuffer or it was passed in from mina
private[naggati] var dynamicBuffer = false
Expand Down Expand Up @@ -103,7 +107,7 @@ class State protected[naggati](firstStep: Step, val session: IoSession, val out:
data.clear
currentStep = firstStep
nextStep = End
buffer = IoBuffer.EMPTY_BUFFER
buffer = State.EMPTY_BUFFER
dynamicBuffer = false
}

Expand Down

0 comments on commit 5efb5c1

Please sign in to comment.