nghttpx: Use 's' for param of Response::return

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-07 23:00:01 +09:00
parent 39287314d3
commit 21a3edfc60
1 changed files with 6 additions and 5 deletions

View File

@ -180,8 +180,9 @@ mrb_value response_return(mrb_state *mrb, mrb_value self) {
mrb_raise(mrb, E_RUNTIME_ERROR, "response has already been committed");
}
mrb_value val;
mrb_get_args(mrb, "|o", &val);
const char *val;
mrb_int vallen;
mrb_get_args(mrb, "|s", &val, &vallen);
const uint8_t *body = nullptr;
size_t bodylen = 0;
@ -195,9 +196,9 @@ mrb_value response_return(mrb_state *mrb, mrb_value self) {
data->response_headers_dirty = false;
}
if (downstream->expect_response_body() && !mrb_nil_p(val)) {
body = reinterpret_cast<const uint8_t *>(RSTRING_PTR(val));
bodylen = RSTRING_LEN(val);
if (downstream->expect_response_body() && vallen > 0) {
body = reinterpret_cast<const uint8_t *>(val);
bodylen = vallen;
}
auto cl = downstream->get_response_header(http2::HD_CONTENT_LENGTH);