infinite loop in TextFrameStream
fommil opened this issue · 1 comments
fommil commented
isn't this an infinite loop? Shouldn't the apply
be adding a chunk size and using the new
keyword.
object TextFrameStream {
def apply(payload: InputStream): TextFrameStream = TextFrameStream(payload)
}
final case class TextFrameStream(chunkSize: Int, payload: InputStream) extends FrameStream {
def opcode = Opcode.Text
}
just do this on the REPL to see
spray.can.websocket.frame.TextFrameStream(new java.io.FileInputStream("some file here"))
pangiole commented
Yes, you're write! That clearly is an infinite recursion nobody (except us) seems to be worried of :-O
And nowhere in spray-websocket the TextFrameStream.apply()
method is invoked with one argument. I can rather see TextFrameStream.apply()
invoked passing 2 arguments by UHttpTest only, but that refers to the case class.
It seems the source code needs some cleanup ...