1 ext/fcgi/fcgi.c | 23 +++++++++++++----------
2 1 files changed, 13 insertions(+), 10 deletions(-)
4 diff --git a/ext/fcgi/fcgi.c b/ext/fcgi/fcgi.c
5 index 8539890..0e26b79 100755
8 @@ -222,7 +222,7 @@ static VALUE fcgi_stream_write(VALUE self, VALUE str)
10 Data_Get_Struct(self, FCGX_Stream, stream);
11 str = rb_obj_as_string(str);
12 - len = FCGX_PutStr(RSTRING(str)->ptr, RSTRING(str)->len, stream);
13 + len = FCGX_PutStr(RSTRING_PTR(str), RSTRING_LEN(str), stream);
14 if (len == EOF) CHECK_STREAM_ERROR(stream);
17 @@ -266,16 +266,19 @@ static VALUE fcgi_stream_printf(int argc, VALUE *argv, VALUE out)
19 static VALUE fcgi_stream_puts _((int, VALUE*, VALUE));
21 -static VALUE fcgi_stream_puts_ary(VALUE ary, VALUE out)
22 +static VALUE fcgi_stream_puts_ary(VALUE ary, VALUE out, int recur)
27 - for (i=0; i<RARRAY(ary)->len; i++) {
28 - tmp = RARRAY(ary)->ptr[i];
29 - if (rb_inspecting_p(tmp)) {
30 - tmp = rb_str_new2("[...]");
33 + tmp = rb_str_new2("[...]");
34 + fcgi_stream_puts(1, &tmp, out);
38 + for (i=0; i<RARRAY_LEN(ary); i++) {
39 + tmp = RARRAY_PTR(ary)[i];
40 fcgi_stream_puts(1, &tmp, out);
43 @@ -297,7 +300,7 @@ static VALUE fcgi_stream_puts(int argc, VALUE *argv, VALUE out)
44 line = rb_str_new2("nil");
47 - rb_protect_inspect(fcgi_stream_puts_ary, argv[i], out);
48 + rb_exec_recursive(fcgi_stream_puts_ary, argv[i], out);
52 @@ -305,7 +308,7 @@ static VALUE fcgi_stream_puts(int argc, VALUE *argv, VALUE out)
54 line = rb_obj_as_string(line);
55 fcgi_stream_write(out, line);
56 - if (RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') {
57 + if (RSTRING_PTR(line)[RSTRING_LEN(line)-1] != '\n') {
58 fcgi_stream_write(out, rb_default_rs);
61 @@ -379,7 +382,7 @@ static VALUE fcgi_stream_gets(VALUE self)
62 rb_str_cat(str, buff, strlen(buff));
63 if (strchr(buff, '\n')) break;
65 - if (RSTRING(str)->len > 0)
66 + if (RSTRING_LEN(str) > 0)