{"action":"created","comment":{"url":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/comments/93821304","pull_request_review_id":14357211,"id":93821304,"diff_hunk":"@@ -164,24 +171,73 @@ ngx_http_lua_rewrite_handler(ngx_http_request_t *r)\n \n \n ngx_int_t\n-ngx_http_lua_rewrite_handler_inline(ngx_http_request_t *r)\n+ngx_http_lua_rewrite_handler_sets(ngx_http_request_t *r)\n {\n-    lua_State                   *L;\n     ngx_int_t                    rc;\n     ngx_http_lua_loc_conf_t     *llcf;\n+    ngx_http_lua_ctx_t          *ctx;\n+    ngx_uint_t                   i;\n+    ngx_http_lua_phase_ctx_t    *phase_ctx;\n \n-    dd(\"rewrite by lua inline\");\n+    dd(\"rewrite by lua handler sets\");\n+\n+    rc = NGX_DECLINED;\n+\n+    ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);\n+\n+    dd(\"ctx = %p\", ctx);\n+\n+    if (ctx == NULL) {\n+        ctx = ngx_http_lua_create_ctx(r);\n+        if (ctx == NULL) {\n+            return NGX_HTTP_INTERNAL_SERVER_ERROR;\n+        }\n+    }\n+\n+    dd(\"entered rewrite by lua handler sets[%ld]\", ctx->rewrite_index);\n \n     llcf = ngx_http_get_module_loc_conf(r, ngx_http_lua_module);\n+\n+    phase_ctx = llcf->rewrites->elts;\n+\n+    for (i = ctx->rewrite_index; i < llcf->rewrites->nelts; ++i)\n+    {","path":"src/ngx_http_lua_rewriteby.c","position":51,"original_position":51,"commit_id":"1c8a1ebf50f8b7f54bcfcb585a0663fb860d3e1c","original_commit_id":"1c8a1ebf50f8b7f54bcfcb585a0663fb860d3e1c","user":{"login":"agentzh","id":56241,"avatar_url":"https://avatars.githubusercontent.com/u/56241?v=3","gravatar_id":"","url":"https://api.github.com/users/agentzh","html_url":"https://github.com/agentzh","followers_url":"https://api.github.com/users/agentzh/followers","following_url":"https://api.github.com/users/agentzh/following{/other_user}","gists_url":"https://api.github.com/users/agentzh/gists{/gist_id}","starred_url":"https://api.github.com/users/agentzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agentzh/subscriptions","organizations_url":"https://api.github.com/users/agentzh/orgs","repos_url":"https://api.github.com/users/agentzh/repos","events_url":"https://api.github.com/users/agentzh/events{/privacy}","received_events_url":"https://api.github.com/users/agentzh/received_events","type":"User","site_admin":false},"body":"Coding style: `{` should be in the previous line if the previous line is not splitted into multiple lines itself.","created_at":"2016-12-24T20:49:40Z","updated_at":"2016-12-24T20:58:46Z","html_url":"https://github.com/openresty/lua-nginx-module/pull/935#discussion_r93821304","pull_request_url":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935","_links":{"self":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/comments/93821304"},"html":{"href":"https://github.com/openresty/lua-nginx-module/pull/935#discussion_r93821304"},"pull_request":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935"}}},"pull_request":{"url":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935","id":98850538,"html_url":"https://github.com/openresty/lua-nginx-module/pull/935","diff_url":"https://github.com/openresty/lua-nginx-module/pull/935.diff","patch_url":"https://github.com/openresty/lua-nginx-module/pull/935.patch","issue_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/935","number":935,"state":"open","locked":false,"title":"support duplicate rewrite directives","user":{"login":"membphis","id":6814606,"avatar_url":"https://avatars.githubusercontent.com/u/6814606?v=3","gravatar_id":"","url":"https://api.github.com/users/membphis","html_url":"https://github.com/membphis","followers_url":"https://api.github.com/users/membphis/followers","following_url":"https://api.github.com/users/membphis/following{/other_user}","gists_url":"https://api.github.com/users/membphis/gists{/gist_id}","starred_url":"https://api.github.com/users/membphis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/membphis/subscriptions","organizations_url":"https://api.github.com/users/membphis/orgs","repos_url":"https://api.github.com/users/membphis/repos","events_url":"https://api.github.com/users/membphis/events{/privacy}","received_events_url":"https://api.github.com/users/membphis/received_events","type":"User","site_admin":false},"body":"Its only support `rewrite` directive now. I'll add more directives in later.\r\n","created_at":"2016-12-21T00:19:57Z","updated_at":"2016-12-24T20:58:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"200ef13d54b13ca18bba631ef776f770af3ff154","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935/commits","review_comments_url":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935/comments","review_comment_url":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/935/comments","statuses_url":"https://api.github.com/repos/openresty/lua-nginx-module/statuses/1c8a1ebf50f8b7f54bcfcb585a0663fb860d3e1c","head":{"label":"iresty:feature/duplicate_directives","ref":"feature/duplicate_directives","sha":"1c8a1ebf50f8b7f54bcfcb585a0663fb860d3e1c","user":{"login":"iresty","id":13067587,"avatar_url":"https://avatars.githubusercontent.com/u/13067587?v=3","gravatar_id":"","url":"https://api.github.com/users/iresty","html_url":"https://github.com/iresty","followers_url":"https://api.github.com/users/iresty/followers","following_url":"https://api.github.com/users/iresty/following{/other_user}","gists_url":"https://api.github.com/users/iresty/gists{/gist_id}","starred_url":"https://api.github.com/users/iresty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iresty/subscriptions","organizations_url":"https://api.github.com/users/iresty/orgs","repos_url":"https://api.github.com/users/iresty/repos","events_url":"https://api.github.com/users/iresty/events{/privacy}","received_events_url":"https://api.github.com/users/iresty/received_events","type":"Organization","site_admin":false},"repo":{"id":65907384,"name":"lua-nginx-module","full_name":"iresty/lua-nginx-module","owner":{"login":"iresty","id":13067587,"avatar_url":"https://avatars.githubusercontent.com/u/13067587?v=3","gravatar_id":"","url":"https://api.github.com/users/iresty","html_url":"https://github.com/iresty","followers_url":"https://api.github.com/users/iresty/followers","following_url":"https://api.github.com/users/iresty/following{/other_user}","gists_url":"https://api.github.com/users/iresty/gists{/gist_id}","starred_url":"https://api.github.com/users/iresty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iresty/subscriptions","organizations_url":"https://api.github.com/users/iresty/orgs","repos_url":"https://api.github.com/users/iresty/repos","events_url":"https://api.github.com/users/iresty/events{/privacy}","received_events_url":"https://api.github.com/users/iresty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iresty/lua-nginx-module","description":"Embed the Power of Lua into NGINX HTTP servers","fork":true,"url":"https://api.github.com/repos/iresty/lua-nginx-module","forks_url":"https://api.github.com/repos/iresty/lua-nginx-module/forks","keys_url":"https://api.github.com/repos/iresty/lua-nginx-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iresty/lua-nginx-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iresty/lua-nginx-module/teams","hooks_url":"https://api.github.com/repos/iresty/lua-nginx-module/hooks","issue_events_url":"https://api.github.com/repos/iresty/lua-nginx-module/issues/events{/number}","events_url":"https://api.github.com/repos/iresty/lua-nginx-module/events","assignees_url":"https://api.github.com/repos/iresty/lua-nginx-module/assignees{/user}","branches_url":"https://api.github.com/repos/iresty/lua-nginx-module/branches{/branch}","tags_url":"https://api.github.com/repos/iresty/lua-nginx-module/tags","blobs_url":"https://api.github.com/repos/iresty/lua-nginx-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iresty/lua-nginx-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iresty/lua-nginx-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/iresty/lua-nginx-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iresty/lua-nginx-module/statuses/{sha}","languages_url":"https://api.github.com/repos/iresty/lua-nginx-module/languages","stargazers_url":"https://api.github.com/repos/iresty/lua-nginx-module/stargazers","contributors_url":"https://api.github.com/repos/iresty/lua-nginx-module/contributors","subscribers_url":"https://api.github.com/repos/iresty/lua-nginx-module/subscribers","subscription_url":"https://api.github.com/repos/iresty/lua-nginx-module/subscription","commits_url":"https://api.github.com/repos/iresty/lua-nginx-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/iresty/lua-nginx-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/iresty/lua-nginx-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/iresty/lua-nginx-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/iresty/lua-nginx-module/contents/{+path}","compare_url":"https://api.github.com/repos/iresty/lua-nginx-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iresty/lua-nginx-module/merges","archive_url":"https://api.github.com/repos/iresty/lua-nginx-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iresty/lua-nginx-module/downloads","issues_url":"https://api.github.com/repos/iresty/lua-nginx-module/issues{/number}","pulls_url":"https://api.github.com/repos/iresty/lua-nginx-module/pulls{/number}","milestones_url":"https://api.github.com/repos/iresty/lua-nginx-module/milestones{/number}","notifications_url":"https://api.github.com/repos/iresty/lua-nginx-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iresty/lua-nginx-module/labels{/name}","releases_url":"https://api.github.com/repos/iresty/lua-nginx-module/releases{/id}","deployments_url":"https://api.github.com/repos/iresty/lua-nginx-module/deployments","created_at":"2016-08-17T12:53:27Z","updated_at":"2016-08-17T12:53:30Z","pushed_at":"2016-12-24T00:05:18Z","git_url":"git://github.com/iresty/lua-nginx-module.git","ssh_url":"git@github.com:iresty/lua-nginx-module.git","clone_url":"https://github.com/iresty/lua-nginx-module.git","svn_url":"https://github.com/iresty/lua-nginx-module","homepage":"https://openresty.org/","size":12116,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"openresty:master","ref":"master","sha":"5028d63536ac795dc56a996416f79279f2f13d5d","user":{"login":"openresty","id":7390180,"avatar_url":"https://avatars.githubusercontent.com/u/7390180?v=3","gravatar_id":"","url":"https://api.github.com/users/openresty","html_url":"https://github.com/openresty","followers_url":"https://api.github.com/users/openresty/followers","following_url":"https://api.github.com/users/openresty/following{/other_user}","gists_url":"https://api.github.com/users/openresty/gists{/gist_id}","starred_url":"https://api.github.com/users/openresty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openresty/subscriptions","organizations_url":"https://api.github.com/users/openresty/orgs","repos_url":"https://api.github.com/users/openresty/repos","events_url":"https://api.github.com/users/openresty/events{/privacy}","received_events_url":"https://api.github.com/users/openresty/received_events","type":"Organization","site_admin":false},"repo":{"id":613829,"name":"lua-nginx-module","full_name":"openresty/lua-nginx-module","owner":{"login":"openresty","id":7390180,"avatar_url":"https://avatars.githubusercontent.com/u/7390180?v=3","gravatar_id":"","url":"https://api.github.com/users/openresty","html_url":"https://github.com/openresty","followers_url":"https://api.github.com/users/openresty/followers","following_url":"https://api.github.com/users/openresty/following{/other_user}","gists_url":"https://api.github.com/users/openresty/gists{/gist_id}","starred_url":"https://api.github.com/users/openresty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openresty/subscriptions","organizations_url":"https://api.github.com/users/openresty/orgs","repos_url":"https://api.github.com/users/openresty/repos","events_url":"https://api.github.com/users/openresty/events{/privacy}","received_events_url":"https://api.github.com/users/openresty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openresty/lua-nginx-module","description":"Embed the Power of Lua into NGINX HTTP servers","fork":false,"url":"https://api.github.com/repos/openresty/lua-nginx-module","forks_url":"https://api.github.com/repos/openresty/lua-nginx-module/forks","keys_url":"https://api.github.com/repos/openresty/lua-nginx-module/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openresty/lua-nginx-module/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openresty/lua-nginx-module/teams","hooks_url":"https://api.github.com/repos/openresty/lua-nginx-module/hooks","issue_events_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/events{/number}","events_url":"https://api.github.com/repos/openresty/lua-nginx-module/events","assignees_url":"https://api.github.com/repos/openresty/lua-nginx-module/assignees{/user}","branches_url":"https://api.github.com/repos/openresty/lua-nginx-module/branches{/branch}","tags_url":"https://api.github.com/repos/openresty/lua-nginx-module/tags","blobs_url":"https://api.github.com/repos/openresty/lua-nginx-module/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openresty/lua-nginx-module/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openresty/lua-nginx-module/git/refs{/sha}","trees_url":"https://api.github.com/repos/openresty/lua-nginx-module/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openresty/lua-nginx-module/statuses/{sha}","languages_url":"https://api.github.com/repos/openresty/lua-nginx-module/languages","stargazers_url":"https://api.github.com/repos/openresty/lua-nginx-module/stargazers","contributors_url":"https://api.github.com/repos/openresty/lua-nginx-module/contributors","subscribers_url":"https://api.github.com/repos/openresty/lua-nginx-module/subscribers","subscription_url":"https://api.github.com/repos/openresty/lua-nginx-module/subscription","commits_url":"https://api.github.com/repos/openresty/lua-nginx-module/commits{/sha}","git_commits_url":"https://api.github.com/repos/openresty/lua-nginx-module/git/commits{/sha}","comments_url":"https://api.github.com/repos/openresty/lua-nginx-module/comments{/number}","issue_comment_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues/comments{/number}","contents_url":"https://api.github.com/repos/openresty/lua-nginx-module/contents/{+path}","compare_url":"https://api.github.com/repos/openresty/lua-nginx-module/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openresty/lua-nginx-module/merges","archive_url":"https://api.github.com/repos/openresty/lua-nginx-module/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openresty/lua-nginx-module/downloads","issues_url":"https://api.github.com/repos/openresty/lua-nginx-module/issues{/number}","pulls_url":"https://api.github.com/repos/openresty/lua-nginx-module/pulls{/number}","milestones_url":"https://api.github.com/repos/openresty/lua-nginx-module/milestones{/number}","notifications_url":"https://api.github.com/repos/openresty/lua-nginx-module/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openresty/lua-nginx-module/labels{/name}","releases_url":"https://api.github.com/repos/openresty/lua-nginx-module/releases{/id}","deployments_url":"https://api.github.com/repos/openresty/lua-nginx-module/deployments","created_at":"2010-04-16T15:59:01Z","updated_at":"2016-12-24T10:52:01Z","pushed_at":"2016-12-23T11:17:58Z","git_url":"git://github.com/openresty/lua-nginx-module.git","ssh_url":"git@github.com:openresty/lua-nginx-module.git","clone_url":"https://github.com/openresty/lua-nginx-module.git","svn_url":"https://github.com/openresty/lua-nginx-module","homepage":"https://openresty.org/","size":11808,"stargazers_count":3866,"watchers_count":3866,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":903,"mirror_url":null,"open_issues_count":98,"forks":903,"open_issues":98,"watchers":3866,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935"},"html":{"href":"https://github.com/openresty/lua-nginx-module/pull/935"},"issue":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/issues/935"},"comments":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/issues/935/comments"},"review_comments":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935/comments"},"review_comment":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/pulls/935/commits"},"statuses":{"href":"https://api.github.com/repos/openresty/lua-nginx-module/statuses/1c8a1ebf50f8b7f54bcfcb585a0663fb860d3e1c"}}}}
{"actor":{"display_login":"agentzh"}}