kamu-wang 0.05 → 0.06
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wang.rb +7 -1
- data/rakefile +1 -1
- data/wang.gemspec +1 -1
- metadata +1 -1
data/lib/wang.rb
CHANGED
@@ -46,7 +46,7 @@ module WANG
|
|
46
46
|
Timeout::timeout(open_timeout) { super }
|
47
47
|
end
|
48
48
|
|
49
|
-
TIMEOUT_READ = %w{read readpartial gets readline}
|
49
|
+
TIMEOUT_READ = %w{read readpartial gets readline eof?}
|
50
50
|
TIMEOUT_READ.each {|m|
|
51
51
|
class_eval "def #{m}(*args); Timeout::timeout(@read_timeout) { super }; end;"
|
52
52
|
}
|
@@ -168,6 +168,12 @@ module WANG
|
|
168
168
|
@socket << "\r\n"
|
169
169
|
@socket << data if data
|
170
170
|
|
171
|
+
if @socket.eof? #this is the first place after connection start where checking for eof is safe, because we can expect data
|
172
|
+
@socket.close unless @socket.closed?
|
173
|
+
@log.debug("EOF detected, retrying")
|
174
|
+
return request(method, uri, referer, data)
|
175
|
+
end
|
176
|
+
|
171
177
|
status = read_status
|
172
178
|
@log.debug("STATUS: #{status}")
|
173
179
|
headers = read_headers(uri)
|
data/rakefile
CHANGED
@@ -8,7 +8,7 @@ task :default => [:test]
|
|
8
8
|
spec = Gem::Specification.new do |s|
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.name = 'wang'
|
11
|
-
s.version = "0.
|
11
|
+
s.version = "0.06"
|
12
12
|
s.summary = "Web Access with No Grief."
|
13
13
|
s.authors = ["Kamu", "Joux3"]
|
14
14
|
s.email = "mr.kamu@gmail.com"
|
data/wang.gemspec
CHANGED