diff options
-rw-r--r-- | lib/yahns/http_client.rb | 1 | ||||
-rw-r--r-- | lib/yahns/http_context.rb | 3 | ||||
-rw-r--r-- | lib/yahns/http_response.rb | 2 | ||||
-rw-r--r-- | lib/yahns/stream_input.rb | 2 | ||||
-rw-r--r-- | lib/yahns/tee_input.rb | 2 | ||||
-rw-r--r-- | lib/yahns/tiny_input.rb | 7 |
6 files changed, 4 insertions, 13 deletions
diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb index 3ee6011..198c130 100644 --- a/lib/yahns/http_client.rb +++ b/lib/yahns/http_client.rb @@ -1,7 +1,6 @@ # -*- encoding: binary -*- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) -require 'yahns/tiny_input' class Yahns::HttpClient < Kgio::Socket # :nodoc: NULL_IO = StringIO.new("") diff --git a/lib/yahns/http_context.rb b/lib/yahns/http_context.rb index 1af41df..97a0f82 100644 --- a/lib/yahns/http_context.rb +++ b/lib/yahns/http_context.rb @@ -1,7 +1,6 @@ # -*- encoding: binary -*- # Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> and all contributors # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) -require 'yahns/tiny_input' # subclasses of Yahns::HttpClient will class extend this @@ -61,6 +60,6 @@ module Yahns::HttpContext # :nodoc: def tmpio_for(len) len && len <= @client_body_buffer_size ? - Yahns::TinyInput.new("") : Yahns::TmpIO.new + StringIO.new("") : Yahns::TmpIO.new end end diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb index aad2762..8967670 100644 --- a/lib/yahns/http_response.rb +++ b/lib/yahns/http_response.rb @@ -64,7 +64,7 @@ module Yahns::HttpResponse # :nodoc: end def http_response_done(alive) - @input = @input.discard if @input + @input = @input.close if @input if alive @response_start_sent = false # @hs.buf will have data if the client pipelined diff --git a/lib/yahns/stream_input.rb b/lib/yahns/stream_input.rb index f0a43b3..8bef95e 100644 --- a/lib/yahns/stream_input.rb +++ b/lib/yahns/stream_input.rb @@ -145,6 +145,6 @@ class Yahns::StreamInput # :nodoc: raise Yahns::ClientShutdown, "bytes_read=#{@bytes_read}", [] end - def discard # return nil + def close # return nil end end diff --git a/lib/yahns/tee_input.rb b/lib/yahns/tee_input.rb index 0d91a89..9028a6e 100644 --- a/lib/yahns/tee_input.rb +++ b/lib/yahns/tee_input.rb @@ -108,7 +108,7 @@ class Yahns::TeeInput < Yahns::StreamInput # :nodoc: buffer end - def discard + def close # returns nil @tmp = @tmp.close end end diff --git a/lib/yahns/tiny_input.rb b/lib/yahns/tiny_input.rb deleted file mode 100644 index 55bdd03..0000000 --- a/lib/yahns/tiny_input.rb +++ /dev/null @@ -1,7 +0,0 @@ -# -*- encoding: binary -*- -# Copyright (C) 2013, Eric Wong <normalperson@yhbt.net> et. al. -# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) -class Yahns::TinyInput < StringIO # :nodoc: - def discard # just returns nil - end -end |