summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-11-20 07:45:57 +0800
committerEric Wong <normalperson@yhbt.net>2010-11-20 07:49:58 +0800
commitcd315e5a20b17d29679fb22b4e2ab44cd6d0edeb (patch)
treea9f376d6facf9f26acc404463bd4769fa93b81f0
parent5bc239fd154a7eaebeb024394f8e0b507bbf4c5a (diff)
There's no difference because of the \A anchor, but sub!
is doesn't loop so it's simpler.
-rw-r--r--lib/unicorn/stream_input.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/unicorn/stream_input.rb b/lib/unicorn/stream_input.rb
index 45d1336..619067d 100644
--- a/lib/unicorn/stream_input.rb
+++ b/lib/unicorn/stream_input.rb
@@ -80,7 +80,7 @@ class Unicorn::StreamInput
     re = /\A(.*?#{Regexp.escape(sep)})/
 
     begin
-      @rbuf.gsub!(re, '') and return $1
+      @rbuf.sub!(re, '') and return $1
       return @rbuf.empty? ? nil : @rbuf.slice!(0, @rbuf.size) if eof?
       @socket.kgio_read(@@io_chunk_size, @buf) or eof!
       filter_body(once = '', @buf)