[Groonga-commit] groonga/grntest at 514c633 [master] Use the original JSON to support invalid JSON

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 26 14:51:24 JST 2015


Kouhei Sutou	2015-01-26 14:51:24 +0900 (Mon, 26 Jan 2015)

  New Revision: 514c633f391b6fb3b2135b37f8b5bfe8f954de70
  https://github.com/groonga/grntest/commit/514c633f391b6fb3b2135b37f8b5bfe8f954de70

  Message:
    Use the original JSON to support invalid JSON

  Modified files:
    lib/grntest/executors/http-executor.rb

  Modified: lib/grntest/executors/http-executor.rb (+6 -6)
===================================================================
--- lib/grntest/executors/http-executor.rb    2015-01-26 14:50:18 +0900 (c92b934)
+++ lib/grntest/executors/http-executor.rb    2015-01-26 14:51:24 +0900 (05ea615)
@@ -62,16 +62,16 @@ module Grntest
         Groonga::Command::Parser.parse(command_line)
       end
 
-      MAX_URI_SIZE = 4096
       def send_load_command(command)
-        if command.to_uri_format.size <= MAX_URI_SIZE
-          return send_normal_command(command)
-        end
-
         values = command.arguments.delete(:values)
         request = Net::HTTP::Post.new(command.to_uri_format)
         request.content_type = "application/json; charset=UTF-8"
-        request.body = values
+        lines = command.original_source.lines
+        if lines[1].start_with?("[")
+          request.body = lines[1..-1].join
+        else
+          request.body = values
+        end
         response = Net::HTTP.start(@host, @port) do |http|
           http.read_timeout = @read_timeout
           http.request(request)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index