Skip to content

Instantly share code, notes, and snippets.

@yano3
Created December 16, 2016 10:28
Show Gist options
  • Save yano3/2034a7539760ed904eff401e52319981 to your computer and use it in GitHub Desktop.
Save yano3/2034a7539760ed904eff401e52319981 to your computer and use it in GitHub Desktop.
diff --git src/http/ngx_http_mruby_filter.c src/http/ngx_http_mruby_filter.c
index 91e8e00..e90642d 100644
--- src/http/ngx_http_mruby_filter.c
+++ src/http/ngx_http_mruby_filter.c
@@ -34,7 +34,7 @@ static mrb_value ngx_mrb_set_filter_body(mrb_state *mrb, mrb_value self)
body = mrb_funcall(mrb, body, "to_s", 0, NULL);
}
- ctx->body = (u_char *)mrb_str_to_cstr(mrb, body);
+ ctx->body = (u_char *)RSTRING_PTR(body);
ctx->body_length = RSTRING_LEN(body);
return mrb_fixnum_value(ctx->body_length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment