[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-core
Subject:    [Patch] ext/openssl/lib/net/https.rb: Remove warnings
From:       Florian_Groß <florgro () gmail ! com>
Date:       2005-10-28 23:55:53
Message-ID: djudl8$ra6$1 () sea ! gmane ! org
[Download RAW message or body]

Moin.

I noticed that there is a few warnings when using https.rb from the 
openssl extension:

> d:/ruby/lib/ruby/site_ruby/1.8/net/https.rb:121: warning: method redefined; discarding old edit_path 
> d:/ruby/lib/ruby/site_ruby/1.8/net/https.rb:130: warning: redefine socket_type                       
> d:/ruby/lib/ruby/site_ruby/1.8/net/https.rb:157: warning: method redefined; discarding old on_connect

The attached (simple) patch fixes these by invoking remove_method() 
before redefining the methods.

It is against 1.8.2. If this has already been fixed in 1.8.3 or 1.9 
please ignore this message.

Thank you!

Kind regards,
Florian Gross

["https.patch" (text/plain)]

--- https.rb.original	2003-07-29 15:21:44.000000000 +0200
+++ https.rb	2005-10-29 01:45:46.984375000 +0200
@@ -124,6 +124,7 @@
     end
 
     module ProxyMod
+      remove_method :edit_path
       def edit_path( path )
         if use_ssl
           'https://' + addr_port + path
@@ -133,6 +134,10 @@
       end
     end
 
+    class << self
+      remove_method :socket_type
+    end
+
     def self.socket_type
       SSLIO
     end
@@ -160,6 +165,7 @@
       @use_ssl = flag
     end
 
+    remove_method :on_connect
     def on_connect
       if use_ssl
         if proxy?


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic