So, I tested this idea out.  The reality is, it does a GET request for each line in a file.  So, for a 35 line /etc/passwd, it has to do 35ish get requests.   that will take let's say 30ish seconds to run.  So, would it be better to not incorporate your idea at all  -or-   a  much longer timeout like this code:

	begin
      Timeout.timeout(600) do |i|
        loop do
            #Run this code for 10 minutes max
            file = sqli(left_marker, right_marker, sql_true, i, cookie, filename)
            return if file.nil?
            break if file.empty?
            str = [file].pack("H*")
            full << str
            vprint_status(str)
            i = i+1
        end
      end
    rescue Timeout::Error
    #Code has been running for more than 10 minutes. Bail.
    end