{"action":"created","comment":{"url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/comments/187796922","pull_request_review_id":119650698,"id":187796922,"diff_hunk":"@@ -125,6 +126,12 @@ static void ngx_mrb_timer_handler(ngx_event_t *ev)\n         rc = NGX_HTTP_INTERNAL_SERVER_ERROR;\n       }\n \n+      if (ctx->set_var_target.len > 0) {\n+        // Delete the leading dollar(ctx->set_var_target.data+1)\n+        ngx_mrb_var_set(re->mrb, mrb_top_self(re->mrb), (char *)ctx->set_var_target.data + 1,","path":"src/http/ngx_http_mruby_async.c","position":14,"original_position":14,"commit_id":"34aae84eea424eace7c2578a2e122851a9cf32c2","original_commit_id":"34aae84eea424eace7c2578a2e122851a9cf32c2","user":{"login":"pyama86","id":8022082,"avatar_url":"https://avatars0.githubusercontent.com/u/8022082?v=4","gravatar_id":"","url":"https://api.github.com/users/pyama86","html_url":"https://github.com/pyama86","followers_url":"https://api.github.com/users/pyama86/followers","following_url":"https://api.github.com/users/pyama86/following{/other_user}","gists_url":"https://api.github.com/users/pyama86/gists{/gist_id}","starred_url":"https://api.github.com/users/pyama86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyama86/subscriptions","organizations_url":"https://api.github.com/users/pyama86/orgs","repos_url":"https://api.github.com/users/pyama86/repos","events_url":"https://api.github.com/users/pyama86/events{/privacy}","received_events_url":"https://api.github.com/users/pyama86/received_events","type":"User","site_admin":false},"body":"オブジェクト化 = strncpyなどを利用して明示的に文字数で複製するという意味であっていますか？","created_at":"2018-05-13T11:09:47Z","updated_at":"2018-05-13T11:09:47Z","html_url":"https://github.com/matsumotory/ngx_mruby/pull/355#discussion_r187796922","pull_request_url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/comments/187796922"},"html":{"href":"https://github.com/matsumotory/ngx_mruby/pull/355#discussion_r187796922"},"pull_request":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355"}},"in_reply_to_id":187796718},"pull_request":{"url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355","id":187663054,"html_url":"https://github.com/matsumotory/ngx_mruby/pull/355","diff_url":"https://github.com/matsumotory/ngx_mruby/pull/355.diff","patch_url":"https://github.com/matsumotory/ngx_mruby/pull/355.patch","issue_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/355","number":355,"state":"open","locked":false,"title":"Support async setcode","user":{"login":"pyama86","id":8022082,"avatar_url":"https://avatars0.githubusercontent.com/u/8022082?v=4","gravatar_id":"","url":"https://api.github.com/users/pyama86","html_url":"https://github.com/pyama86","followers_url":"https://api.github.com/users/pyama86/followers","following_url":"https://api.github.com/users/pyama86/following{/other_user}","gists_url":"https://api.github.com/users/pyama86/gists{/gist_id}","starred_url":"https://api.github.com/users/pyama86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyama86/subscriptions","organizations_url":"https://api.github.com/users/pyama86/orgs","repos_url":"https://api.github.com/users/pyama86/repos","events_url":"https://api.github.com/users/pyama86/events{/privacy}","received_events_url":"https://api.github.com/users/pyama86/received_events","type":"User","site_admin":false},"body":"## Pull-Request Check List\r\nNginx::Async.sleep利用時に、rewrite_handlerから見るとmrubyのset_codeのrubyコードはsleepを待たずに終了して見えるため、後続の[ngx_http_script_set_var_code](https://github.com/phusion/nginx/blob/master/src/http/ngx_http_script.c#L1666)が空振り実行されてしまい、timer後のmrubyの戻り値が変数に設定されない問題がありました。\r\n\r\nこのPRでは設定する変数名をコンテキストに記憶しておき、timer後にその変数名に対してmrubyコードの戻り値を設定することで意図した動作になるように変更しています。\r\n\r\n- [x] Add patches into `src/`.\r\n- [x] Add test into `test/`. Please see about [test docs](https://github.com/matsumotory/ngx_mruby/tree/master/docs/test).\r\n- [x] Add docs into `docs/` if you change the features such as [build system](https://github.com/matsumotory/ngx_mruby/tree/master/docs/install), [Ruby methods, class](https://github.com/matsumotory/ngx_mruby/tree/master/docs/class_and_method) and [nginx directives](https://github.com/matsumotory/ngx_mruby/tree/master/docs/directives).\r\n","created_at":"2018-05-13T10:32:52Z","updated_at":"2018-05-13T11:09:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cf0e4a97bcd4b431b7401901287fd49583d1622","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355/commits","review_comments_url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355/comments","review_comment_url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/355/comments","statuses_url":"https://api.github.com/repos/matsumotory/ngx_mruby/statuses/34aae84eea424eace7c2578a2e122851a9cf32c2","head":{"label":"matsumotory:support-async-setcode","ref":"support-async-setcode","sha":"34aae84eea424eace7c2578a2e122851a9cf32c2","user":{"login":"matsumotory","id":648437,"avatar_url":"https://avatars0.githubusercontent.com/u/648437?v=4","gravatar_id":"","url":"https://api.github.com/users/matsumotory","html_url":"https://github.com/matsumotory","followers_url":"https://api.github.com/users/matsumotory/followers","following_url":"https://api.github.com/users/matsumotory/following{/other_user}","gists_url":"https://api.github.com/users/matsumotory/gists{/gist_id}","starred_url":"https://api.github.com/users/matsumotory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matsumotory/subscriptions","organizations_url":"https://api.github.com/users/matsumotory/orgs","repos_url":"https://api.github.com/users/matsumotory/repos","events_url":"https://api.github.com/users/matsumotory/events{/privacy}","received_events_url":"https://api.github.com/users/matsumotory/received_events","type":"User","site_admin":false},"repo":{"id":4246391,"name":"ngx_mruby","full_name":"matsumotory/ngx_mruby","owner":{"login":"matsumotory","id":648437,"avatar_url":"https://avatars0.githubusercontent.com/u/648437?v=4","gravatar_id":"","url":"https://api.github.com/users/matsumotory","html_url":"https://github.com/matsumotory","followers_url":"https://api.github.com/users/matsumotory/followers","following_url":"https://api.github.com/users/matsumotory/following{/other_user}","gists_url":"https://api.github.com/users/matsumotory/gists{/gist_id}","starred_url":"https://api.github.com/users/matsumotory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matsumotory/subscriptions","organizations_url":"https://api.github.com/users/matsumotory/orgs","repos_url":"https://api.github.com/users/matsumotory/repos","events_url":"https://api.github.com/users/matsumotory/events{/privacy}","received_events_url":"https://api.github.com/users/matsumotory/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matsumotory/ngx_mruby","description":"ngx_mruby - A Fast and Memory-Efficient Web Server Extension Mechanism Using Scripting Language mruby for nginx","fork":false,"url":"https://api.github.com/repos/matsumotory/ngx_mruby","forks_url":"https://api.github.com/repos/matsumotory/ngx_mruby/forks","keys_url":"https://api.github.com/repos/matsumotory/ngx_mruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matsumotory/ngx_mruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matsumotory/ngx_mruby/teams","hooks_url":"https://api.github.com/repos/matsumotory/ngx_mruby/hooks","issue_events_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/events{/number}","events_url":"https://api.github.com/repos/matsumotory/ngx_mruby/events","assignees_url":"https://api.github.com/repos/matsumotory/ngx_mruby/assignees{/user}","branches_url":"https://api.github.com/repos/matsumotory/ngx_mruby/branches{/branch}","tags_url":"https://api.github.com/repos/matsumotory/ngx_mruby/tags","blobs_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matsumotory/ngx_mruby/statuses/{sha}","languages_url":"https://api.github.com/repos/matsumotory/ngx_mruby/languages","stargazers_url":"https://api.github.com/repos/matsumotory/ngx_mruby/stargazers","contributors_url":"https://api.github.com/repos/matsumotory/ngx_mruby/contributors","subscribers_url":"https://api.github.com/repos/matsumotory/ngx_mruby/subscribers","subscription_url":"https://api.github.com/repos/matsumotory/ngx_mruby/subscription","commits_url":"https://api.github.com/repos/matsumotory/ngx_mruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/matsumotory/ngx_mruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/matsumotory/ngx_mruby/contents/{+path}","compare_url":"https://api.github.com/repos/matsumotory/ngx_mruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matsumotory/ngx_mruby/merges","archive_url":"https://api.github.com/repos/matsumotory/ngx_mruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matsumotory/ngx_mruby/downloads","issues_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues{/number}","pulls_url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls{/number}","milestones_url":"https://api.github.com/repos/matsumotory/ngx_mruby/milestones{/number}","notifications_url":"https://api.github.com/repos/matsumotory/ngx_mruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matsumotory/ngx_mruby/labels{/name}","releases_url":"https://api.github.com/repos/matsumotory/ngx_mruby/releases{/id}","deployments_url":"https://api.github.com/repos/matsumotory/ngx_mruby/deployments","created_at":"2012-05-07T04:35:12Z","updated_at":"2018-05-08T02:50:36Z","pushed_at":"2018-05-13T10:53:44Z","git_url":"git://github.com/matsumotory/ngx_mruby.git","ssh_url":"git@github.com:matsumotory/ngx_mruby.git","clone_url":"https://github.com/matsumotory/ngx_mruby.git","svn_url":"https://github.com/matsumotory/ngx_mruby","homepage":"http://ngx.mruby.org/","size":7800,"stargazers_count":774,"watchers_count":774,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":85,"mirror_url":null,"archived":false,"open_issues_count":23,"license":null,"forks":85,"open_issues":23,"watchers":774,"default_branch":"master"}},"base":{"label":"matsumotory:v2-dev","ref":"v2-dev","sha":"b2c2033a08820028dba584284dd94228dada27cb","user":{"login":"matsumotory","id":648437,"avatar_url":"https://avatars0.githubusercontent.com/u/648437?v=4","gravatar_id":"","url":"https://api.github.com/users/matsumotory","html_url":"https://github.com/matsumotory","followers_url":"https://api.github.com/users/matsumotory/followers","following_url":"https://api.github.com/users/matsumotory/following{/other_user}","gists_url":"https://api.github.com/users/matsumotory/gists{/gist_id}","starred_url":"https://api.github.com/users/matsumotory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matsumotory/subscriptions","organizations_url":"https://api.github.com/users/matsumotory/orgs","repos_url":"https://api.github.com/users/matsumotory/repos","events_url":"https://api.github.com/users/matsumotory/events{/privacy}","received_events_url":"https://api.github.com/users/matsumotory/received_events","type":"User","site_admin":false},"repo":{"id":4246391,"name":"ngx_mruby","full_name":"matsumotory/ngx_mruby","owner":{"login":"matsumotory","id":648437,"avatar_url":"https://avatars0.githubusercontent.com/u/648437?v=4","gravatar_id":"","url":"https://api.github.com/users/matsumotory","html_url":"https://github.com/matsumotory","followers_url":"https://api.github.com/users/matsumotory/followers","following_url":"https://api.github.com/users/matsumotory/following{/other_user}","gists_url":"https://api.github.com/users/matsumotory/gists{/gist_id}","starred_url":"https://api.github.com/users/matsumotory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matsumotory/subscriptions","organizations_url":"https://api.github.com/users/matsumotory/orgs","repos_url":"https://api.github.com/users/matsumotory/repos","events_url":"https://api.github.com/users/matsumotory/events{/privacy}","received_events_url":"https://api.github.com/users/matsumotory/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matsumotory/ngx_mruby","description":"ngx_mruby - A Fast and Memory-Efficient Web Server Extension Mechanism Using Scripting Language mruby for nginx","fork":false,"url":"https://api.github.com/repos/matsumotory/ngx_mruby","forks_url":"https://api.github.com/repos/matsumotory/ngx_mruby/forks","keys_url":"https://api.github.com/repos/matsumotory/ngx_mruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matsumotory/ngx_mruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matsumotory/ngx_mruby/teams","hooks_url":"https://api.github.com/repos/matsumotory/ngx_mruby/hooks","issue_events_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/events{/number}","events_url":"https://api.github.com/repos/matsumotory/ngx_mruby/events","assignees_url":"https://api.github.com/repos/matsumotory/ngx_mruby/assignees{/user}","branches_url":"https://api.github.com/repos/matsumotory/ngx_mruby/branches{/branch}","tags_url":"https://api.github.com/repos/matsumotory/ngx_mruby/tags","blobs_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matsumotory/ngx_mruby/statuses/{sha}","languages_url":"https://api.github.com/repos/matsumotory/ngx_mruby/languages","stargazers_url":"https://api.github.com/repos/matsumotory/ngx_mruby/stargazers","contributors_url":"https://api.github.com/repos/matsumotory/ngx_mruby/contributors","subscribers_url":"https://api.github.com/repos/matsumotory/ngx_mruby/subscribers","subscription_url":"https://api.github.com/repos/matsumotory/ngx_mruby/subscription","commits_url":"https://api.github.com/repos/matsumotory/ngx_mruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/matsumotory/ngx_mruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/matsumotory/ngx_mruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/matsumotory/ngx_mruby/contents/{+path}","compare_url":"https://api.github.com/repos/matsumotory/ngx_mruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matsumotory/ngx_mruby/merges","archive_url":"https://api.github.com/repos/matsumotory/ngx_mruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matsumotory/ngx_mruby/downloads","issues_url":"https://api.github.com/repos/matsumotory/ngx_mruby/issues{/number}","pulls_url":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls{/number}","milestones_url":"https://api.github.com/repos/matsumotory/ngx_mruby/milestones{/number}","notifications_url":"https://api.github.com/repos/matsumotory/ngx_mruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matsumotory/ngx_mruby/labels{/name}","releases_url":"https://api.github.com/repos/matsumotory/ngx_mruby/releases{/id}","deployments_url":"https://api.github.com/repos/matsumotory/ngx_mruby/deployments","created_at":"2012-05-07T04:35:12Z","updated_at":"2018-05-08T02:50:36Z","pushed_at":"2018-05-13T10:53:44Z","git_url":"git://github.com/matsumotory/ngx_mruby.git","ssh_url":"git@github.com:matsumotory/ngx_mruby.git","clone_url":"https://github.com/matsumotory/ngx_mruby.git","svn_url":"https://github.com/matsumotory/ngx_mruby","homepage":"http://ngx.mruby.org/","size":7800,"stargazers_count":774,"watchers_count":774,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":85,"mirror_url":null,"archived":false,"open_issues_count":23,"license":null,"forks":85,"open_issues":23,"watchers":774,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355"},"html":{"href":"https://github.com/matsumotory/ngx_mruby/pull/355"},"issue":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/355"},"comments":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/issues/355/comments"},"review_comments":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355/comments"},"review_comment":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/pulls/355/commits"},"statuses":{"href":"https://api.github.com/repos/matsumotory/ngx_mruby/statuses/34aae84eea424eace7c2578a2e122851a9cf32c2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"pyama86"}}