{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/60224790","id":60224790,"diff_hunk":"@@ -57,202 +60,216 @@ private[http] final class BodyPartParser(defaultContentType: ContentType,\n     if (illegalHeaderWarnings) log.warning(errorInfo.withSummaryPrepended(\"Illegal multipart header\").formatPretty)\n   }\n \n-  private[this] var output = collection.immutable.Queue.empty[Output] // FIXME this probably is too wasteful\n-  private[this] var state: ByteString ⇒ StateResult = tryParseInitialBoundary\n-  private[this] var terminated = false\n-\n-  def warnOnIllegalHeader(errorInfo: ErrorInfo): Unit =\n-    if (illegalHeaderWarnings) log.warning(errorInfo.withSummaryPrepended(\"Illegal multipart header\").formatPretty)\n-\n-  override def onPush(input: ByteString, ctx: Context[Output]): SyncDirective =\n-    if (!terminated) {\n-      try state(input)\n-      catch {\n-        case e: ParsingException ⇒ fail(e.info)\n-        case NotEnoughDataException ⇒\n-          // we are missing a try/catch{continue} wrapper somewhere\n-          throw new IllegalStateException(\"unexpected NotEnoughDataException\", NotEnoughDataException)\n+  val in = Inlet[ByteString](\"BodyPartParser.in\")\n+  val out = Outlet[BodyPartParser.Output](\"BodyPartParser.out\")\n+\n+  override val shape = FlowShape(in, out)\n+\n+  override def createLogic(attributes: Attributes): GraphStageLogic =\n+    new GraphStageLogic(shape) with InHandler with OutHandler {\n+      private var output = collection.immutable.Queue.empty[Output]","path":"akka-http-core/src/main/scala/akka/http/impl/engine/parsing/BodyPartParser.scala","position":53,"original_position":53,"commit_id":"b025545800ef3e1f974ef355f9abcf156135106e","original_commit_id":"b025545800ef3e1f974ef355f9abcf156135106e","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":"I attempted that at some point btw and the results were surprising so this'll need a bit more investigation than it may seem at first: https://github.com/akka/akka/issues/18994****","created_at":"2016-04-19T12:56:01Z","updated_at":"2016-04-19T12:56:01Z","html_url":"https://github.com/akka/akka/pull/20356#discussion_r60224790","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/20356","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/60224790"},"html":{"href":"https://github.com/akka/akka/pull/20356#discussion_r60224790"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/20356"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/20356","id":66866325,"html_url":"https://github.com/akka/akka/pull/20356","diff_url":"https://github.com/akka/akka/pull/20356.diff","patch_url":"https://github.com/akka/akka/pull/20356.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/20356","number":20356,"state":"open","locked":false,"title":"Migrate BodyPartParser to GraphStage #20288.","user":{"login":"danxmoran","id":2755881,"avatar_url":"https://avatars.githubusercontent.com/u/2755881?v=3","gravatar_id":"","url":"https://api.github.com/users/danxmoran","html_url":"https://github.com/danxmoran","followers_url":"https://api.github.com/users/danxmoran/followers","following_url":"https://api.github.com/users/danxmoran/following{/other_user}","gists_url":"https://api.github.com/users/danxmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/danxmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danxmoran/subscriptions","organizations_url":"https://api.github.com/users/danxmoran/orgs","repos_url":"https://api.github.com/users/danxmoran/repos","events_url":"https://api.github.com/users/danxmoran/events{/privacy}","received_events_url":"https://api.github.com/users/danxmoran/received_events","type":"User","site_admin":false},"body":"Ref #20288.\r\n\r\n@johanandren here's BodyPartParser from #20327.  I'll open a follow-up with NaiveTake and ByteStringBatcher once this merges, to avoid adding noise with duplicate changes.","created_at":"2016-04-18T14:49:44Z","updated_at":"2016-04-19T12:56:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"043c4d4622b59307f0ba8394dea0f020bb55e771","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/20356/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/20356/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/20356/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/b025545800ef3e1f974ef355f9abcf156135106e","head":{"label":"danxmoran:danxmoran-20288-bodypartparser-to-gs","ref":"danxmoran-20288-bodypartparser-to-gs","sha":"b025545800ef3e1f974ef355f9abcf156135106e","user":{"login":"danxmoran","id":2755881,"avatar_url":"https://avatars.githubusercontent.com/u/2755881?v=3","gravatar_id":"","url":"https://api.github.com/users/danxmoran","html_url":"https://github.com/danxmoran","followers_url":"https://api.github.com/users/danxmoran/followers","following_url":"https://api.github.com/users/danxmoran/following{/other_user}","gists_url":"https://api.github.com/users/danxmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/danxmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danxmoran/subscriptions","organizations_url":"https://api.github.com/users/danxmoran/orgs","repos_url":"https://api.github.com/users/danxmoran/repos","events_url":"https://api.github.com/users/danxmoran/events{/privacy}","received_events_url":"https://api.github.com/users/danxmoran/received_events","type":"User","site_admin":false},"repo":{"id":50397237,"name":"akka","full_name":"danxmoran/akka","owner":{"login":"danxmoran","id":2755881,"avatar_url":"https://avatars.githubusercontent.com/u/2755881?v=3","gravatar_id":"","url":"https://api.github.com/users/danxmoran","html_url":"https://github.com/danxmoran","followers_url":"https://api.github.com/users/danxmoran/followers","following_url":"https://api.github.com/users/danxmoran/following{/other_user}","gists_url":"https://api.github.com/users/danxmoran/gists{/gist_id}","starred_url":"https://api.github.com/users/danxmoran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danxmoran/subscriptions","organizations_url":"https://api.github.com/users/danxmoran/orgs","repos_url":"https://api.github.com/users/danxmoran/repos","events_url":"https://api.github.com/users/danxmoran/events{/privacy}","received_events_url":"https://api.github.com/users/danxmoran/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danxmoran/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/danxmoran/akka","forks_url":"https://api.github.com/repos/danxmoran/akka/forks","keys_url":"https://api.github.com/repos/danxmoran/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danxmoran/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danxmoran/akka/teams","hooks_url":"https://api.github.com/repos/danxmoran/akka/hooks","issue_events_url":"https://api.github.com/repos/danxmoran/akka/issues/events{/number}","events_url":"https://api.github.com/repos/danxmoran/akka/events","assignees_url":"https://api.github.com/repos/danxmoran/akka/assignees{/user}","branches_url":"https://api.github.com/repos/danxmoran/akka/branches{/branch}","tags_url":"https://api.github.com/repos/danxmoran/akka/tags","blobs_url":"https://api.github.com/repos/danxmoran/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danxmoran/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danxmoran/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/danxmoran/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danxmoran/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/danxmoran/akka/languages","stargazers_url":"https://api.github.com/repos/danxmoran/akka/stargazers","contributors_url":"https://api.github.com/repos/danxmoran/akka/contributors","subscribers_url":"https://api.github.com/repos/danxmoran/akka/subscribers","subscription_url":"https://api.github.com/repos/danxmoran/akka/subscription","commits_url":"https://api.github.com/repos/danxmoran/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/danxmoran/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/danxmoran/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/danxmoran/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/danxmoran/akka/contents/{+path}","compare_url":"https://api.github.com/repos/danxmoran/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danxmoran/akka/merges","archive_url":"https://api.github.com/repos/danxmoran/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danxmoran/akka/downloads","issues_url":"https://api.github.com/repos/danxmoran/akka/issues{/number}","pulls_url":"https://api.github.com/repos/danxmoran/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/danxmoran/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/danxmoran/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danxmoran/akka/labels{/name}","releases_url":"https://api.github.com/repos/danxmoran/akka/releases{/id}","deployments_url":"https://api.github.com/repos/danxmoran/akka/deployments","created_at":"2016-01-26T02:31:39Z","updated_at":"2016-01-26T02:31:50Z","pushed_at":"2016-04-18T14:46:18Z","git_url":"git://github.com/danxmoran/akka.git","ssh_url":"git@github.com:danxmoran/akka.git","clone_url":"https://github.com/danxmoran/akka.git","svn_url":"https://github.com/danxmoran/akka","homepage":"http://akka.io","size":192328,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"akka:master","ref":"master","sha":"ade89edbb7b6d17db1a544a9c4674e910a9fec23","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","deployments_url":"https://api.github.com/repos/akka/akka/deployments","created_at":"2009-02-16T12:51:54Z","updated_at":"2016-04-19T10:09:51Z","pushed_at":"2016-04-19T12:16:04Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":204603,"stargazers_count":5384,"watchers_count":5384,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1678,"mirror_url":null,"open_issues_count":726,"forks":1678,"open_issues":726,"watchers":5384,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/20356"},"html":{"href":"https://github.com/akka/akka/pull/20356"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/20356"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/20356/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/20356/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/20356/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/b025545800ef3e1f974ef355f9abcf156135106e"}}}}