about summary refs log tree commit homepage
path: root/ext/clogger_ext/ruby_1_9_compat.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-12-16 20:38:10 +0000
committerEric Wong <normalperson@yhbt.net>2014-05-12 06:33:24 +0000
commit58f027b6c7bf6bb319e5601594219887770edcc7 (patch)
treeb3020ed3a5f21937792d1e2fc079234e3f37a21e /ext/clogger_ext/ruby_1_9_compat.h
parent2b2971794c5deda8fd1b100041c24f06ae55337c (diff)
:to_io never was a Rack extension, and ends up breaking the case
where an SSL socket is proxied.  The role of :to_io in IO-like
objects is to aid IO.select and like methods.
Diffstat (limited to 'ext/clogger_ext/ruby_1_9_compat.h')
-rw-r--r--ext/clogger_ext/ruby_1_9_compat.h31
1 files changed, 0 insertions, 31 deletions
diff --git a/ext/clogger_ext/ruby_1_9_compat.h b/ext/clogger_ext/ruby_1_9_compat.h
index b5653dc..de9f074 100644
--- a/ext/clogger_ext/ruby_1_9_compat.h
+++ b/ext/clogger_ext/ruby_1_9_compat.h
@@ -18,34 +18,3 @@ static void rb_18_str_set_len(VALUE str, long len)
 }
 #define rb_str_set_len(str,len) rb_18_str_set_len(str,len)
 #endif
-
-#if ! HAVE_RB_IO_T
-#  define rb_io_t OpenFile
-#endif
-
-#ifdef GetReadFile
-#  define FPTR_TO_FD(fptr) (fileno(GetReadFile(fptr)))
-#else
-#  if !HAVE_RB_IO_T || (RUBY_VERSION_MAJOR == 1 && RUBY_VERSION_MINOR == 8)
-#    define FPTR_TO_FD(fptr) fileno(fptr->f)
-#  else
-#    define FPTR_TO_FD(fptr) fptr->fd
-#  endif
-#endif
-
-static int my_fileno(VALUE io)
-{
-        rb_io_t *fptr;
-
-        for (;;) {
-                switch (TYPE(io)) {
-                case T_FILE: {
-                        GetOpenFile(io, fptr);
-                        return FPTR_TO_FD(fptr);
-                }
-                default:
-                        io = rb_convert_type(io, T_FILE, "IO", "to_io");
-                        /* retry */
-                }
-        }
-}