matsumoto-r/ngx_mruby — pull request #9 by cubicdaiya (2012-12-29 16:33:25+00:00)
Title: fix invalid parameter type

1. str is u_char, but strlen receives const char *(ngx_strlen casts const char * internally)
1. mrb_str_new2's second parameter type is const char *, but pass ngx_str_t *

1. and 2. raises the compile errors like the following depending on (default) compiler's flag.

```sh
../ngx_mruby/ngx_http_mruby_request.c: In function ‘ngx_mrb_set_content_type’:
../ngx_mruby/ngx_http_mruby_request.c:53:5: error: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Werror=pointer-sign]
/usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘u_char *’
../ngx_mruby/ngx_http_mruby_request.c: In function ‘ngx_mrb_get_request_uri’:
../ngx_mruby/ngx_http_mruby_request.c:62:5: error: passing argument 2 of ‘mrb_str_new2’ from incompatible pointer type [-Werror]
../ngx_mruby/mruby/include/mruby.h:203:11: note: expected ‘const char *’ but argument is of type ‘struct ngx_str_t *’
```

Especially 2. is a bug obviously.