about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-02-06 11:01:25 +0000
committerEric Wong <normalperson@yhbt.net>2011-02-06 11:01:25 +0000
commit8215605dd182c15f70448035a8f75833351b211b (patch)
tree4883cf84ee8ae163545487313a1fa061b602d554
parent677556d96e2713894c863ec271aa9ccb6b704e1f (diff)
downloadkcar-8215605dd182c15f70448035a8f75833351b211b.tar.gz
rb_str_update and rb_str_flush have been gone for
ages, now.
-rw-r--r--ext/kcar/ext_help.h13
-rw-r--r--ext/kcar/kcar.rl3
2 files changed, 3 insertions, 13 deletions
diff --git a/ext/kcar/ext_help.h b/ext/kcar/ext_help.h
index b6be7ce..ec081e2 100644
--- a/ext/kcar/ext_help.h
+++ b/ext/kcar/ext_help.h
@@ -8,24 +8,17 @@
 #define RSTRING_LEN(s) (RSTRING(s)->len)
 #endif /* !defined(RSTRING_LEN) */
 
-#ifndef RUBINIUS
-#  define rb_str_update(x) do {} while (0)
-#  define rb_str_flush(x) do {} while (0)
-#endif /* !RUBINIUS */
-
 #ifndef HAVE_RB_STR_SET_LEN
 #  ifdef RUBINIUS
-#    define rb_str_set_len(str,len) rb_str_resize(str,len)
-#  else /* 1.8.6 optimized version */
+#    error we should never get here with current Rubinius (1.x)
+#  endif
 /* this is taken from Ruby 1.8.7, 1.8.6 may not have it */
 static void rb_18_str_set_len(VALUE str, long len)
 {
   RSTRING(str)->len = len;
   RSTRING(str)->ptr[len] = '\0';
-  rb_str_flush(str);
 }
-#    define rb_str_set_len(str,len) rb_18_str_set_len(str,len)
-#  endif /* ! RUBINIUS */
+# define rb_str_set_len(str,len) rb_18_str_set_len(str,len)
 #endif /* !defined(HAVE_RB_STR_SET_LEN) */
 
 /* not all Ruby implementations support frozen objects (Rubinius does not) */
diff --git a/ext/kcar/kcar.rl b/ext/kcar/kcar.rl
index 52b6a88..5b620ac 100644
--- a/ext/kcar/kcar.rl
+++ b/ext/kcar/kcar.rl
@@ -500,8 +500,6 @@ static VALUE headers(VALUE self, VALUE hdr, VALUE data)
 {
   struct http_parser *hp = data_get(self);
 
-  rb_str_update(data);
-
   http_parser_execute(hp, hdr, RSTRING_PTR(data), RSTRING_LEN(data));
   VALIDATE_MAX_LENGTH(hp->offset, HEADER);
 
@@ -600,7 +598,6 @@ static VALUE filter_body(VALUE self, VALUE buf, VALUE data)
   char *dptr;
   long dlen;
 
-  rb_str_update(data);
   dptr = RSTRING_PTR(data);
   dlen = RSTRING_LEN(data);