Permalink
Browse files

no error when 304 while fetching a feed by its url

  • Loading branch information...
1 parent 7aa45ec commit 4c394abf67232bd13fa320177ff2bc63d13ebc56 @archiloque archiloque committed Jul 9, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/feedzirra/feed.rb
View
@@ -255,7 +255,11 @@ def self.add_url_to_multi(multi, url, url_queue, responses, options)
curl.on_failure do |c, err|
add_url_to_multi(multi, url_queue.shift, url_queue, responses, options) unless url_queue.empty?
responses[url] = c.response_code
- options[:on_failure].call(url, c.response_code, c.header_str, c.body_str) if options.has_key?(:on_failure)
+ if c.response_code == 304 # it's not modified. this isn't an error condition
+ options[:on_success].call(url, nil) if options.has_key?(:on_success)
+ else
+ options[:on_failure].call(url, c.response_code, c.header_str, c.body_str) if options.has_key?(:on_failure)
+ end
end
end
multi.add(easy)

0 comments on commit 4c394ab

Please sign in to comment.