{"action":"created","comment":{"url":"https://api.github.com/repos/layerhq/cowboy/pulls/comments/24864156","id":24864156,"diff_hunk":"@@ -368,14 +371,37 @@ handle_frame(State, {syn_stream, StreamID, AssocToStreamID,\n %% Erlang does not allow us to control the priority of processes\n %% so we ignore that value entirely.\n handle_frame(State=#state{middlewares=Middlewares, env=Env,\n-\t\tonrequest=OnRequest, onresponse=OnResponse, peer=Peer},\n+\t\tonrequest=OnRequest, onresponse=OnResponse, peer=Peer,\n+\t  max_concurrent_streams=MaxConcurrentStreams },\n \t\t{syn_stream, StreamID, _, IsFin, _, _,\n \t\tMethod, _, Host, Path, Version, Headers}) ->\n-\tPid = spawn_link(?MODULE, request_init, [\n+    case MaxConcurrentStreams of\n+        undefined ->\n+\t    Pid = spawn_link(?MODULE, request_init, [\n \t\t{self(), StreamID}, Peer, OnRequest, OnResponse,\n \t\tEnv, Middlewares, Method, Host, Path, Version, Headers\n-\t]),\n-\tnew_child(State, StreamID, Pid, IsFin);\n+\t\t]),\n+\t\tnew_child(State, StreamID, Pid, IsFin);\n+\t_ ->\n+\t    %% max_concurrent_stream check\n+\t    Children = State#state{children=childrens},","path":"src/cowboy_spdy.erl","position":67,"original_position":67,"commit_id":"63ce654017d27bc713a775334b5b5063618dd85b","original_commit_id":"63ce654017d27bc713a775334b5b5063618dd85b","user":{"login":"jpuigm","id":484125,"avatar_url":"https://avatars.githubusercontent.com/u/484125?v=3","gravatar_id":"","url":"https://api.github.com/users/jpuigm","html_url":"https://github.com/jpuigm","followers_url":"https://api.github.com/users/jpuigm/followers","following_url":"https://api.github.com/users/jpuigm/following{/other_user}","gists_url":"https://api.github.com/users/jpuigm/gists{/gist_id}","starred_url":"https://api.github.com/users/jpuigm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpuigm/subscriptions","organizations_url":"https://api.github.com/users/jpuigm/orgs","repos_url":"https://api.github.com/users/jpuigm/repos","events_url":"https://api.github.com/users/jpuigm/events{/privacy}","received_events_url":"https://api.github.com/users/jpuigm/received_events","type":"User","site_admin":false},"body":"True to what @nwt about the pattern matching in `handle_frame` function head. However, note you are actually using an atom `childrens` instead of a variable. Also, that assignment will return in a record, not the children itself.","created_at":"2015-02-17T23:06:36Z","updated_at":"2015-02-17T23:06:36Z","html_url":"https://github.com/layerhq/cowboy/pull/9#discussion_r24864156","pull_request_url":"https://api.github.com/repos/layerhq/cowboy/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/layerhq/cowboy/pulls/comments/24864156"},"html":{"href":"https://github.com/layerhq/cowboy/pull/9#discussion_r24864156"},"pull_request":{"href":"https://api.github.com/repos/layerhq/cowboy/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/layerhq/cowboy/pulls/9","id":29312745,"html_url":"https://github.com/layerhq/cowboy/pull/9","diff_url":"https://github.com/layerhq/cowboy/pull/9.diff","patch_url":"https://github.com/layerhq/cowboy/pull/9.patch","issue_url":"https://api.github.com/repos/layerhq/cowboy/issues/9","number":9,"state":"open","locked":false,"title":"PLAT-1387: Adding SETTINGS_MAX_CONCURRENT_STREAMS in SPDY Settings frame","user":{"login":"mubarak","id":668134,"avatar_url":"https://avatars.githubusercontent.com/u/668134?v=3","gravatar_id":"","url":"https://api.github.com/users/mubarak","html_url":"https://github.com/mubarak","followers_url":"https://api.github.com/users/mubarak/followers","following_url":"https://api.github.com/users/mubarak/following{/other_user}","gists_url":"https://api.github.com/users/mubarak/gists{/gist_id}","starred_url":"https://api.github.com/users/mubarak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mubarak/subscriptions","organizations_url":"https://api.github.com/users/mubarak/orgs","repos_url":"https://api.github.com/users/mubarak/repos","events_url":"https://api.github.com/users/mubarak/events{/privacy}","received_events_url":"https://api.github.com/users/mubarak/received_events","type":"User","site_admin":false},"body":"As advised by Noah:\r\nhttps://layerhq.atlassian.net/browse/PLAT-1387?focusedCommentId=15758&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15758\r\n\r\nTo support rate limiting feature in tmc, we are setting MAX_CONCURRENT_STREAMS ID/Pair in SPDY Settings frame. Please refer https://layerhq.atlassian.net/browse/PLAT-1387\r\n\r\nCan you please review @nwt\r\n\r\nThanks.","created_at":"2015-02-14T01:30:21Z","updated_at":"2015-02-17T23:06:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4d625d78da1ad3c18f8dfb2aefa8e0bedf13853","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/layerhq/cowboy/pulls/9/commits","review_comments_url":"https://api.github.com/repos/layerhq/cowboy/pulls/9/comments","review_comment_url":"https://api.github.com/repos/layerhq/cowboy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/layerhq/cowboy/issues/9/comments","statuses_url":"https://api.github.com/repos/layerhq/cowboy/statuses/63ce654017d27bc713a775334b5b5063618dd85b","head":{"label":"layerhq:feature_PLAT-1387_rate_limiting","ref":"feature_PLAT-1387_rate_limiting","sha":"63ce654017d27bc713a775334b5b5063618dd85b","user":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"repo":{"id":18858062,"name":"cowboy","full_name":"layerhq/cowboy","owner":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/layerhq/cowboy","description":"Small, fast, modular HTTP server written in Erlang.","fork":true,"url":"https://api.github.com/repos/layerhq/cowboy","forks_url":"https://api.github.com/repos/layerhq/cowboy/forks","keys_url":"https://api.github.com/repos/layerhq/cowboy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/layerhq/cowboy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/layerhq/cowboy/teams","hooks_url":"https://api.github.com/repos/layerhq/cowboy/hooks","issue_events_url":"https://api.github.com/repos/layerhq/cowboy/issues/events{/number}","events_url":"https://api.github.com/repos/layerhq/cowboy/events","assignees_url":"https://api.github.com/repos/layerhq/cowboy/assignees{/user}","branches_url":"https://api.github.com/repos/layerhq/cowboy/branches{/branch}","tags_url":"https://api.github.com/repos/layerhq/cowboy/tags","blobs_url":"https://api.github.com/repos/layerhq/cowboy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/layerhq/cowboy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/layerhq/cowboy/git/refs{/sha}","trees_url":"https://api.github.com/repos/layerhq/cowboy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/layerhq/cowboy/statuses/{sha}","languages_url":"https://api.github.com/repos/layerhq/cowboy/languages","stargazers_url":"https://api.github.com/repos/layerhq/cowboy/stargazers","contributors_url":"https://api.github.com/repos/layerhq/cowboy/contributors","subscribers_url":"https://api.github.com/repos/layerhq/cowboy/subscribers","subscription_url":"https://api.github.com/repos/layerhq/cowboy/subscription","commits_url":"https://api.github.com/repos/layerhq/cowboy/commits{/sha}","git_commits_url":"https://api.github.com/repos/layerhq/cowboy/git/commits{/sha}","comments_url":"https://api.github.com/repos/layerhq/cowboy/comments{/number}","issue_comment_url":"https://api.github.com/repos/layerhq/cowboy/issues/comments/{number}","contents_url":"https://api.github.com/repos/layerhq/cowboy/contents/{+path}","compare_url":"https://api.github.com/repos/layerhq/cowboy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/layerhq/cowboy/merges","archive_url":"https://api.github.com/repos/layerhq/cowboy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/layerhq/cowboy/downloads","issues_url":"https://api.github.com/repos/layerhq/cowboy/issues{/number}","pulls_url":"https://api.github.com/repos/layerhq/cowboy/pulls{/number}","milestones_url":"https://api.github.com/repos/layerhq/cowboy/milestones{/number}","notifications_url":"https://api.github.com/repos/layerhq/cowboy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/layerhq/cowboy/labels{/name}","releases_url":"https://api.github.com/repos/layerhq/cowboy/releases{/id}","created_at":"2014-04-16T22:07:23Z","updated_at":"2015-02-12T17:43:55Z","pushed_at":"2015-02-16T23:39:22Z","git_url":"git://github.com/layerhq/cowboy.git","ssh_url":"git@github.com:layerhq/cowboy.git","clone_url":"https://github.com/layerhq/cowboy.git","svn_url":"https://github.com/layerhq/cowboy","homepage":"http://ninenines.eu","size":5969,"stargazers_count":0,"watchers_count":0,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"layer"}},"base":{"label":"layerhq:layer","ref":"layer","sha":"df719c0c21046d26841543b893b9a81f1bbe844b","user":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"repo":{"id":18858062,"name":"cowboy","full_name":"layerhq/cowboy","owner":{"login":"layerhq","id":5497685,"avatar_url":"https://avatars.githubusercontent.com/u/5497685?v=3","gravatar_id":"","url":"https://api.github.com/users/layerhq","html_url":"https://github.com/layerhq","followers_url":"https://api.github.com/users/layerhq/followers","following_url":"https://api.github.com/users/layerhq/following{/other_user}","gists_url":"https://api.github.com/users/layerhq/gists{/gist_id}","starred_url":"https://api.github.com/users/layerhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/layerhq/subscriptions","organizations_url":"https://api.github.com/users/layerhq/orgs","repos_url":"https://api.github.com/users/layerhq/repos","events_url":"https://api.github.com/users/layerhq/events{/privacy}","received_events_url":"https://api.github.com/users/layerhq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/layerhq/cowboy","description":"Small, fast, modular HTTP server written in Erlang.","fork":true,"url":"https://api.github.com/repos/layerhq/cowboy","forks_url":"https://api.github.com/repos/layerhq/cowboy/forks","keys_url":"https://api.github.com/repos/layerhq/cowboy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/layerhq/cowboy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/layerhq/cowboy/teams","hooks_url":"https://api.github.com/repos/layerhq/cowboy/hooks","issue_events_url":"https://api.github.com/repos/layerhq/cowboy/issues/events{/number}","events_url":"https://api.github.com/repos/layerhq/cowboy/events","assignees_url":"https://api.github.com/repos/layerhq/cowboy/assignees{/user}","branches_url":"https://api.github.com/repos/layerhq/cowboy/branches{/branch}","tags_url":"https://api.github.com/repos/layerhq/cowboy/tags","blobs_url":"https://api.github.com/repos/layerhq/cowboy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/layerhq/cowboy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/layerhq/cowboy/git/refs{/sha}","trees_url":"https://api.github.com/repos/layerhq/cowboy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/layerhq/cowboy/statuses/{sha}","languages_url":"https://api.github.com/repos/layerhq/cowboy/languages","stargazers_url":"https://api.github.com/repos/layerhq/cowboy/stargazers","contributors_url":"https://api.github.com/repos/layerhq/cowboy/contributors","subscribers_url":"https://api.github.com/repos/layerhq/cowboy/subscribers","subscription_url":"https://api.github.com/repos/layerhq/cowboy/subscription","commits_url":"https://api.github.com/repos/layerhq/cowboy/commits{/sha}","git_commits_url":"https://api.github.com/repos/layerhq/cowboy/git/commits{/sha}","comments_url":"https://api.github.com/repos/layerhq/cowboy/comments{/number}","issue_comment_url":"https://api.github.com/repos/layerhq/cowboy/issues/comments/{number}","contents_url":"https://api.github.com/repos/layerhq/cowboy/contents/{+path}","compare_url":"https://api.github.com/repos/layerhq/cowboy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/layerhq/cowboy/merges","archive_url":"https://api.github.com/repos/layerhq/cowboy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/layerhq/cowboy/downloads","issues_url":"https://api.github.com/repos/layerhq/cowboy/issues{/number}","pulls_url":"https://api.github.com/repos/layerhq/cowboy/pulls{/number}","milestones_url":"https://api.github.com/repos/layerhq/cowboy/milestones{/number}","notifications_url":"https://api.github.com/repos/layerhq/cowboy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/layerhq/cowboy/labels{/name}","releases_url":"https://api.github.com/repos/layerhq/cowboy/releases{/id}","created_at":"2014-04-16T22:07:23Z","updated_at":"2015-02-12T17:43:55Z","pushed_at":"2015-02-16T23:39:22Z","git_url":"git://github.com/layerhq/cowboy.git","ssh_url":"git@github.com:layerhq/cowboy.git","clone_url":"https://github.com/layerhq/cowboy.git","svn_url":"https://github.com/layerhq/cowboy","homepage":"http://ninenines.eu","size":5969,"stargazers_count":0,"watchers_count":0,"language":"Erlang","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"layer"}},"_links":{"self":{"href":"https://api.github.com/repos/layerhq/cowboy/pulls/9"},"html":{"href":"https://github.com/layerhq/cowboy/pull/9"},"issue":{"href":"https://api.github.com/repos/layerhq/cowboy/issues/9"},"comments":{"href":"https://api.github.com/repos/layerhq/cowboy/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/layerhq/cowboy/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/layerhq/cowboy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/layerhq/cowboy/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/layerhq/cowboy/statuses/63ce654017d27bc713a775334b5b5063618dd85b"}}}}