{"action":"created","issue":{"url":"https://api.github.com/repos/wandoulabs/spray-websocket/issues/66","labels_url":"https://api.github.com/repos/wandoulabs/spray-websocket/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/wandoulabs/spray-websocket/issues/66/comments","events_url":"https://api.github.com/repos/wandoulabs/spray-websocket/issues/66/events","html_url":"https://github.com/wandoulabs/spray-websocket/issues/66","id":58093501,"number":66,"title":"infinite loop in TextFrameStream","user":{"login":"fommil","id":1914041,"avatar_url":"https://avatars.githubusercontent.com/u/1914041?v=3","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-18T16:47:06Z","updated_at":"2015-08-15T00:05:14Z","closed_at":null,"body":"in https://github.com/wandoulabs/spray-websocket/blob/master/spray-websocket/src/main/scala/spray/can/websocket/frame/Frame.scala#L185\r\n\r\nisn't this an infinite loop? Shouldn't the `apply` be adding a chunk size and using the `new` keyword.\r\n\r\n```\r\nobject TextFrameStream {\r\n  def apply(payload: InputStream): TextFrameStream = TextFrameStream(payload)\r\n}\r\n\r\nfinal case class TextFrameStream(chunkSize: Int, payload: InputStream) extends FrameStream {\r\n  def opcode = Opcode.Text\r\n}\r\n```\r\n\r\njust do this on the REPL to see\r\n\r\n```scala\r\nspray.can.websocket.frame.TextFrameStream(new java.io.FileInputStream(\"some file here\"))\r\n```"},"comment":{"url":"https://api.github.com/repos/wandoulabs/spray-websocket/issues/comments/131269945","html_url":"https://github.com/wandoulabs/spray-websocket/issues/66#issuecomment-131269945","issue_url":"https://api.github.com/repos/wandoulabs/spray-websocket/issues/66","id":131269945,"user":{"login":"angiolep","id":2233786,"avatar_url":"https://avatars.githubusercontent.com/u/2233786?v=3","gravatar_id":"","url":"https://api.github.com/users/angiolep","html_url":"https://github.com/angiolep","followers_url":"https://api.github.com/users/angiolep/followers","following_url":"https://api.github.com/users/angiolep/following{/other_user}","gists_url":"https://api.github.com/users/angiolep/gists{/gist_id}","starred_url":"https://api.github.com/users/angiolep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angiolep/subscriptions","organizations_url":"https://api.github.com/users/angiolep/orgs","repos_url":"https://api.github.com/users/angiolep/repos","events_url":"https://api.github.com/users/angiolep/events{/privacy}","received_events_url":"https://api.github.com/users/angiolep/received_events","type":"User","site_admin":false},"created_at":"2015-08-15T00:05:14Z","updated_at":"2015-08-15T00:05:14Z","body":"Yes, you're write! That clearly is an infinite recursion nobody (except us) seems to be worried of :-O\r\n\r\nAnd 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.\r\n\r\nIt seems the source code needs some cleanup ... \r\n"}}