Nobody wants to touch this one with a 10' pole ? :)
I was able to confirm my theory by sending my service a malformed packet
(ByteString(0, 0, 0, 0) header). I made this crude modification for now to
"fix" it:
@tailrec
def extractFrames(bs: ByteString, acc: List[ByteString]) //
: (Option[ByteString], Seq[ByteString]) = {
if (bs.isEmpty) {
(None, acc)
} else if (bs.length < headerSize) {
(Some(bs.compact), acc)
} else {
val length = bs.iterator.getLongPart(headerSize).toInt
if (length < 0 || length > maxSize)
throw new IllegalArgumentException(
s"received too large frame of size $length (max = $maxSize)")
+ if (0 == length)
+ throw new IllegalArgumentException(
+ s"received data but the frame header indicates 0 length?
discarding")
val total = if (lengthIncludesHeader) length else length +
headerSize
if (bs.length >= total) {
println("slicing from {} to {} currently length {}",
headerSize, total, bs.length)
extractFrames(bs drop total, bs.slice(headerSize, total) :: acc)
} else {
(Some(bs.compact), acc)
}
}
}
Maybe it can help someone else..
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.