Permalink
Browse files

Merge remote branch 'upstream/v1_8_7_330'

  • Loading branch information...
2 parents 637eb2f + b77a464 commit 0fc5c2fff111ac7bd0f64efdd6edb0c03fe40ee5 @FooBarWidget FooBarWidget committed Feb 11, 2011
Showing with 5,505 additions and 1,866 deletions.
  1. +740 −1 ChangeLog
  2. +37 −1 LEGAL
  3. +8 −1 Makefile.in
  4. +1 −0 NEWS
  5. +120 −13 bignum.c
  6. +1 −1 common.mk
  7. +64 −5 configure.in
  8. +1 −1 cygwin/GNUmakefile.in
  9. +19 −6 eval.c
  10. +3 −2 ext/bigdecimal/bigdecimal.c
  11. +12 −0 ext/iconv/iconv.c
  12. +1 −1 ext/nkf/nkf-utf8/nkf.c
  13. +10 −1 ext/openssl/extconf.rb
  14. +3 −2 ext/openssl/lib/openssl.rb
  15. +2 −0 ext/openssl/lib/openssl/buffering.rb
  16. +316 −0 ext/openssl/lib/openssl/config.rb
  17. +1 −1 ext/openssl/lib/openssl/digest.rb
  18. +179 −0 ext/openssl/lib/openssl/ssl-internal.rb
  19. +1 −179 ext/openssl/lib/openssl/ssl.rb
  20. +153 −0 ext/openssl/lib/openssl/x509-internal.rb
  21. +1 −154 ext/openssl/lib/openssl/x509.rb
  22. +9 −6 ext/openssl/openssl_missing.h
  23. +29 −11 ext/openssl/ossl.c
  24. +10 −2 ext/openssl/ossl.h
  25. +22 −25 ext/openssl/ossl_asn1.c
  26. +33 −33 ext/openssl/ossl_bn.c
  27. +3 −1 ext/openssl/ossl_cipher.c
  28. +15 −412 ext/openssl/ossl_config.c
  29. +19 −1 ext/openssl/ossl_engine.c
  30. +1 −1 ext/openssl/ossl_hmac.c
  31. +1 −1 ext/openssl/ossl_ocsp.c
  32. +5 −2 ext/openssl/ossl_pkcs5.c
  33. +30 −10 ext/openssl/ossl_pkcs7.c
  34. +1 −1 ext/openssl/ossl_pkey.c
  35. +4 −4 ext/openssl/ossl_pkey_dh.c
  36. +5 −5 ext/openssl/ossl_pkey_dsa.c
  37. +14 −3 ext/openssl/ossl_pkey_ec.c
  38. +8 −8 ext/openssl/ossl_pkey_rsa.c
  39. +3 −3 ext/openssl/ossl_ssl.c
  40. +17 −8 ext/openssl/ossl_ssl_session.c
  41. +3 −2 ext/openssl/ossl_x509attr.c
  42. +2 −2 ext/openssl/ossl_x509crl.c
  43. +4 −2 ext/openssl/ossl_x509ext.c
  44. +29 −2 ext/openssl/ossl_x509name.c
  45. +6 −0 ext/readline/readline.c
  46. +34 −18 ext/socket/extconf.rb
  47. +1 −1 ext/stringio/stringio.c
  48. +0 −2 ext/win32ole/extconf.rb
  49. +167 −70 ext/win32ole/win32ole.c
  50. +5 −1 ext/zlib/zlib.c
  51. +124 −37 file.c
  52. +2 −0 intern.h
  53. +36 −5 io.c
  54. +5 −2 lib/date.rb
  55. +1 −0 lib/fileutils.rb
  56. +1 −1 lib/mkmf.rb
  57. +14 −10 lib/net/http.rb
  58. +37 −9 lib/net/imap.rb
  59. +2 −3 lib/net/pop.rb
  60. +17 −5 lib/net/smtp.rb
  61. +10 −3 lib/pathname.rb
  62. +1 −1 lib/rational.rb
  63. +69 −33 lib/resolv.rb
  64. +42 −5 lib/rss/maker/base.rb
  65. +2 −1 lib/thwait.rb
  66. +11 −3 lib/timeout.rb
  67. +1 −0 lib/uri/generic.rb
  68. +1 −0 lib/webrick/httprequest.rb
  69. +1 −1 lib/webrick/httpresponse.rb
  70. +1 −0 lib/webrick/https.rb
  71. +2 −2 lib/webrick/httpservlet/filehandler.rb
  72. +3 −2 lib/webrick/httpstatus.rb
  73. +2 −2 lib/webrick/ssl.rb
  74. +72 −70 marshal.c
  75. +7 −0 missing.h
  76. +9 −1 mkconfig.rb
  77. +578 −472 pack.c
  78. +10 −0 parse.y
  79. +7 −1 process.c
  80. +1 −0 re.c
  81. +8 −1 regex.c
  82. +11 −1 ruby.h
  83. +1 −1 string.c
  84. +1 −1 test/iconv/test_option.rb
  85. +33 −0 test/net/http/test_connection.rb
  86. +32 −0 test/net/http/test_post_io.rb
  87. +16 −0 test/net/imap/test_imap.rb
  88. +5 −0 test/nkf/test_nkf.rb
  89. +14 −0 test/openssl/test_asn1.rb
  90. +290 −0 test/openssl/test_config.rb
  91. +1 −3 test/openssl/test_ec.rb
  92. +23 −16 test/openssl/test_x509cert.rb
  93. +24 −4 test/openssl/test_x509crl.rb
  94. +26 −12 test/openssl/test_x509req.rb
  95. +9 −0 test/openssl/utils.rb
  96. +2 −4 test/optparse/test_summary.rb
  97. +16 −0 test/resolv/test_addr.rb
  98. +17 −0 test/rss/test_maker_0.9.rb
  99. +1 −0 test/ruby/bug2519.rb
  100. +17 −0 test/ruby/test_file_exhaustive.rb
  101. +0 −28 test/ruby/test_marshal.rb
  102. +164 −0 test/ruby/test_method.rb
  103. +215 −6 test/ruby/test_pack.rb
  104. +14 −0 test/ruby/test_pipe.rb
  105. +465 −0 test/ruby/test_regexp.rb
  106. +27 −0 test/ruby/test_require.rb
  107. +1 −1 test/ruby/test_string.rb
  108. +21 −0 test/ruby/test_super.rb
  109. +67 −1 test/webrick/test_filehandler.rb
  110. +8 −2 test/webrick/utils.rb
  111. +510 −4 test/zlib/test_zlib.rb
  112. +56 −52 util.c
  113. +6 −6 version.h
  114. +4 −3 win32/Makefile.sub
  115. +1 −1 win32/setup.mak
  116. +68 −5 win32/win32.c
  117. +109 −39 win32/win32.h
View
View
@@ -45,7 +45,6 @@ configure:
config.guess:
config.sub:
-parse.c:
As long as you distribute these files with the file configure, they
are covered under the Ruby's license.
@@ -72,6 +71,43 @@ parse.c:
configuration script generated by Autoconf, you may include it under
the same distribution terms that you use for the rest of that program.
+parse.c:
+
+ This file is licensed under the GPL, but is incorporated into Ruby and
+ redistributed under the terms of the Ruby license, as permitted by the
+ exception to the GPL below.
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+ /* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
util.c (partly):
win32/win32.[ch]:
View
@@ -134,9 +134,16 @@ fake.rb: Makefile
if RUBY_PLATFORM =~ /mswin|bccwin|mingw/; \
class File; \
remove_const :ALT_SEPARATOR; \
- ALT_SEPARATOR = "\\"; \
+ ALT_SEPARATOR = "\\\\"; \
end; \
end; \
+ prehook = proc do |e|; \
+ builddir = File.expand_path(File.dirname(__FILE__)); \
+ Config::MAKEFILE_CONFIG["top_srcdir"] = $$top_srcdir = \
+ File.expand_path("@top_srcdir@", builddir) unless e; \
+ untrace_var(:$$extmk, prehook); \
+ end; \
+ trace_var(:$$extmk, prehook); \
' > $@
Makefile: $(srcdir)/Makefile.in
View
@@ -78,6 +78,7 @@ with all sufficient information, see the ChangeLog file.
* Array#reject
* Array#reject!
* Array#delete_if
+ * Array#select
Return an enumerator if no block is given.
View
@@ -222,7 +222,110 @@ rb_int2inum(n)
return rb_int2big(n);
}
-#ifdef HAVE_LONG_LONG
+#if SIZEOF_LONG % SIZEOF_BDIGITS != 0
+# error unexpected SIZEOF_LONG : SIZEOF_BDIGITS ratio
+#endif
+
+/*
+ * buf is an array of long integers.
+ * buf is ordered from least significant word to most significant word.
+ * buf[0] is the least significant word and
+ * buf[num_longs-1] is the most significant word.
+ * This means words in buf is little endian.
+ * However each word in buf is native endian.
+ * (buf[i]&1) is the least significant bit and
+ * (buf[i]&(1<<(SIZEOF_LONG*CHAR_BIT-1))) is the most significant bit
+ * for each 0 <= i < num_longs.
+ * So buf is little endian at whole on a little endian machine.
+ * But buf is mixed endian on a big endian machine.
+ */
+void
+rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
+{
+ val = rb_to_int(val);
+ if (num_longs == 0)
+ return;
+ if (FIXNUM_P(val)) {
+ long i;
+ long tmp = FIX2LONG(val);
+ buf[0] = (unsigned long)tmp;
+ tmp = tmp < 0 ? ~0L : 0;
+ for (i = 1; i < num_longs; i++)
+ buf[i] = (unsigned long)tmp;
+ return;
+ }
+ else {
+ long len = RBIGNUM_LEN(val);
+ BDIGIT *ds = BDIGITS(val), *dend = ds + len;
+ long i, j;
+ for (i = 0; i < num_longs && ds < dend; i++) {
+ unsigned long l = 0;
+ for (j = 0; j < DIGSPERLONG && ds < dend; j++, ds++) {
+ l |= ((unsigned long)*ds << (j * BITSPERDIG));
+ }
+ buf[i] = l;
+ }
+ for (; i < num_longs; i++)
+ buf[i] = 0;
+ if (RBIGNUM_NEGATIVE_P(val)) {
+ for (i = 0; i < num_longs; i++) {
+ buf[i] = ~buf[i];
+ }
+ for (i = 0; i < num_longs; i++) {
+ buf[i]++;
+ if (buf[i] != 0)
+ return;
+ }
+ }
+ }
+}
+
+/* See rb_big_pack comment for endianness of buf. */
+VALUE
+rb_big_unpack(unsigned long *buf, long num_longs)
+{
+ while (2 <= num_longs) {
+ if (buf[num_longs-1] == 0 && (long)buf[num_longs-2] >= 0)
+ num_longs--;
+ else if (buf[num_longs-1] == ~0UL && (long)buf[num_longs-2] < 0)
+ num_longs--;
+ else
+ break;
+ }
+ if (num_longs == 0)
+ return INT2FIX(0);
+ else if (num_longs == 1)
+ return LONG2NUM((long)buf[0]);
+ else {
+ VALUE big;
+ BDIGIT *ds;
+ long len = num_longs * DIGSPERLONG;
+ long i;
+ big = bignew(len, 1);
+ ds = BDIGITS(big);
+ for (i = 0; i < num_longs; i++) {
+ unsigned long d = buf[i];
+#if SIZEOF_LONG == SIZEOF_BDIGITS
+ *ds++ = d;
+#else
+ int j;
+ for (j = 0; j < DIGSPERLONG; j++) {
+ *ds++ = BIGLO(d);
+ d = BIGDN(d);
+ }
+#endif
+ }
+ if ((long)buf[num_longs-1] < 0) {
+ get2comp(big);
+ RBIGNUM_SET_SIGN(big, 0);
+ }
+ return bignorm(big);
+ }
+}
+
+#define QUAD_SIZE 8
+
+#if SIZEOF_LONG_LONG == QUAD_SIZE && SIZEOF_BDIGITS*2 == SIZEOF_LONG_LONG
void
rb_quad_pack(buf, val)
@@ -295,7 +398,19 @@ rb_quad_unpack(buf, sign)
#else
-#define QUAD_SIZE 8
+static int
+quad_buf_complement(char *buf, size_t len)
+{
+ size_t i;
+ for (i = 0; i < len; i++)
+ buf[i] = ~buf[i];
+ for (i = 0; i < len; i++) {
+ buf[i]++;
+ if (buf[i] != 0)
+ return 0;
+ }
+ return 1;
+}
void
rb_quad_pack(buf, val)
@@ -314,12 +429,8 @@ rb_quad_pack(buf, val)
rb_raise(rb_eRangeError, "bignum too big to convert into `quad int'");
}
memcpy(buf, (char*)BDIGITS(val), len);
- if (!RBIGNUM(val)->sign) {
- len = QUAD_SIZE;
- while (len--) {
- *buf = ~*buf;
- buf++;
- }
+ if (RBIGNUM_NEGATIVE_P(val)) {
+ quad_buf_complement(buf, QUAD_SIZE);
}
}
@@ -334,14 +445,10 @@ rb_quad_unpack(buf, sign)
memcpy((char*)BDIGITS(big), buf, QUAD_SIZE);
if (sign && BNEG(buf)) {
- long len = QUAD_SIZE;
char *tmp = (char*)BDIGITS(big);
RBIGNUM(big)->sign = 0;
- while (len--) {
- *tmp = ~*tmp;
- tmp++;
- }
+ quad_buf_complement(tmp, QUAD_SIZE);
}
return bignorm(big);
View
@@ -312,7 +312,7 @@ extconf:
$(MINIRUBY) -run -e mkdir -- -p "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
-$(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(PREP)
+$(RBCONFIG): $(srcdir)/mkconfig.rb config.status $(srcdir)/version.h $(PREP)
@$(MINIRUBY) $(srcdir)/mkconfig.rb -timestamp=$@ \
-install_name=$(RUBY_INSTALL_NAME) \
-so_name=$(RUBY_SO_NAME) rbconfig.rb
View
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT()
-AC_PREREQ(2.58)
+AC_PREREQ(2.60)
AC_DEFUN([RUBY_MINGW32],
[case "$host_os" in
@@ -217,6 +217,9 @@ cygwin*|mingw*)
esac], [with_winsock2=no])
if test "$with_winsock2" = yes; then
AC_DEFINE(USE_WINSOCK2)
+ COMMON_HEADERS="ws2tcpip.h winsock2.h windows.h"
+ else
+ COMMON_HEADERS="windows.h winsock.h"
fi
esac
: ${enable_shared=yes}
@@ -519,7 +522,7 @@ AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h sys/
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
sys/mkdev.h sys/utime.h netinet/in_systm.h float.h ieeefp.h pthread.h \
- ucontext.h intrinsics.h)
+ intrinsics.h time.h)
dnl Check additional types.
AC_CHECK_SIZEOF(rlim_t, 0, [
@@ -544,6 +547,49 @@ AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_STRUCT_ST_RDEV
+dnl RUBY_DEFINT TYPENAME, SIZE, [SIGNED-OR-UNSIGNED], [INCLUDES = DEFAULT-INCLUDES]
+AC_DEFUN([RUBY_DEFINT], [dnl
+AC_CACHE_CHECK([for $1], [rb_cv_type_$1],
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])
+typedef $1 t; int s = sizeof(t) == 42;])],
+ [rb_cv_type_$1=yes],
+ [AS_CASE([m4_bmatch([$2], [^[1-9][0-9]*$], $2, [$ac_cv_sizeof_]AS_TR_SH($2))],
+ ["1"], [ rb_cv_type_$1="m4_if([$3], [], [signed ], [$3 ])char"],
+ ["$ac_cv_sizeof_short"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])short"],
+ ["$ac_cv_sizeof_int"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])int"],
+ ["$ac_cv_sizeof_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long"],
+ ["$ac_cv_sizeof_long_long"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])long long"],
+ ["$ac_cv_sizeof___int64"], [ rb_cv_type_$1="m4_if([$3], [], [], [$3 ])__int64"],
+ [ rb_cv_type_$1=no])])])
+if test "${rb_cv_type_$1}" != no; then
+ AC_DEFINE([HAVE_]AS_TR_CPP($1), 1)
+ if test "${rb_cv_type_$1}" = yes; then
+ m4_bmatch([$2], [^[1-9][0-9]*$], [AC_CHECK_SIZEOF([$1], 0, [AC_INCLUDES_DEFAULT([$4])])],
+ [RUBY_CHECK_SIZEOF([$1], [$2], [], [AC_INCLUDES_DEFAULT([$4])])])
+ else
+ AC_DEFINE_UNQUOTED($1, [$rb_cv_type_$1])
+ AC_DEFINE_UNQUOTED([SIZEOF_]AS_TR_CPP($1), [SIZEOF_]AS_TR_CPP([$rb_cv_type_$1]))
+ fi
+fi
+])
+
+RUBY_DEFINT(int8_t, 1)
+RUBY_DEFINT(uint8_t, 1, unsigned)
+RUBY_DEFINT(int16_t, 2)
+RUBY_DEFINT(uint16_t, 2, unsigned)
+RUBY_DEFINT(int32_t, 4)
+RUBY_DEFINT(uint32_t, 4, unsigned)
+RUBY_DEFINT(int64_t, 8)
+RUBY_DEFINT(uint64_t, 8, unsigned)
+RUBY_DEFINT(int128_t, 16)
+RUBY_DEFINT(uint128_t, 16, unsigned)
+AC_CHECK_TYPES([struct timezone], [], [], [@%:@ifdef HAVE_TIME_H
+@%:@ include <time.h>
+@%:@endif
+@%:@ifdef HAVE_SYS_TIME_H
+@%:@ include <sys/time.h>
+@%:@endif])
+
dnl Checks for library functions.
AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
@@ -1039,8 +1085,22 @@ if test x"$enable_pthread" = xyes; then
fi
fi
fi
-if test x"$ac_cv_header_ucontext_h" = xyes; then
- if test x"$rb_with_pthread" = xyes; then
+
+use_context=no
+if test x"$rb_with_pthread" = xyes; then
+ AS_CASE("$target_cpu:$target_os:$cross_compiling",
+ [*:linux*:no], [
+ if test -n "`(/lib/libc.so.6 2>/dev/null | fgrep 'linuxthreads') 2> /dev/null`"; then
+ use_context=yes
+ fi
+ ],
+ [sparc*], [
+ use_context=yes
+ ])
+fi
+if test x"$use_context" = xyes; then
+ AC_CHECK_HEADERS(ucontext.h)
+ if test x"$ac_cv_header_ucontext_h" = xyes; then
AC_CHECK_FUNCS(getcontext setcontext)
fi
fi
@@ -1630,7 +1690,6 @@ case "$target_os" in
AC_LIBOBJ([win32])
COMMON_LIBS=m
# COMMON_MACROS="WIN32_LEAN_AND_MEAN="
- COMMON_HEADERS="windows.h winsock.h"
;;
esac
LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
@@ -38,7 +38,7 @@ $(RUBY_EXP) $(LIBRUBY_SO): $(DLL_BASE_NAME).res.@OBJEXT@
%.res.@OBJEXT@: %.rc
@WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
-$(RCFILES): $(RBCONFIG)
+$(RCFILES): $(RBCONFIG) $(srcdir)/version.h $(srcdir)/win32/resource.rb
@$(MINIRUBY) $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
-so_name=$(DLL_BASE_NAME) \
Oops, something went wrong. Retry.

0 comments on commit 0fc5c2f

Please sign in to comment.