]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb
Add the open_id_authentication plugin
[rails.git] / vendor / plugins / open_id_authentication / lib / open_id_authentication / timeout_fixes.rb
diff --git a/vendor/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb b/vendor/plugins/open_id_authentication/lib/open_id_authentication/timeout_fixes.rb
new file mode 100644 (file)
index 0000000..cc711c9
--- /dev/null
@@ -0,0 +1,20 @@
+# http://trac.openidenabled.com/trac/ticket/156
+module OpenID
+  @@timeout_threshold = 20
+
+  def self.timeout_threshold
+    @@timeout_threshold
+  end
+
+  def self.timeout_threshold=(value)
+    @@timeout_threshold = value
+  end
+
+  class StandardFetcher
+    def make_http(uri)
+      http = @proxy.new(uri.host, uri.port)
+      http.read_timeout = http.open_timeout = OpenID.timeout_threshold
+      http
+    end
+  end
+end
\ No newline at end of file