Fix to retrieve current_context for channel_notify_method
@@ -98,8 +98,12 @@ static mrb_value channel_notify_method(mrb_state *mrb, mrb_value self)
struct st_h2o_mruby_channel_context_t *ctx;
ctx = mrb_data_check_get_ptr(mrb, self, &channel_type);
- if (!mrb_nil_p(ctx->receiver))
+ if (!mrb_nil_p(ctx->receiver)) {
h2o_mruby_run_fiber(ctx->ctx, detach_receiver(ctx), mrb_nil_value(), NULL);
+ h2o_mruby_shared_context_t *shared_ctx = mrb->ud;
+ /* When it's called in task, retrieve current_context for next action in task */
+ shared_ctx->current_context = ctx->ctx;
+ }
return mrb_nil_value();
}
