This release is for compatibility with future releases of mainline ruby, as rb_thread_blocking_region is removed in r44955 of ruby trunk This also avoids deprecation warnings fo rb_thread_blocking_region 2.0 and 2.1.
Thanks to Christopher Rigor for this release. Eric Wong (2): only define and test kgio_syssend on 1.9+ various 1.8.7 fixes
This adds a new kgio_syssend method for Ruby 1.9+ which behaves like BasicSocket#send, but will not raise exceptions on EAGAIN. Eric Wong (12): test_poll: remove race prone test_poll_EINTR_changed test tryopen: remove RARRAY_PTR usage in init read_write: remove the rest of RARRAY_PTR usage my_writev: stylistic fixes Rakefile: kill raa_update task avoid downsizing casts connect: constify RSTRING-related things set RSTRING_MODIFIED where appropriate for Rubinius split read_write.c into {read,write,writev}.c add kgio_syssend method to wrap send(2) write: correct check for various blocking regions tryopen: additional debug information for bad Errno values Hleb Valoshka (1): Don't use deprecated api
Improved error reporting for kgio_accept/kgio_tryaccept. Minor size reduction throughout. There are also several test case fixes for race conditions. Thanks to Hleb Valoshka and the Debian project for all the help with this release! Eric Wong (7): check syscall returns against < 0 instead of == -1 accept: more informative exception on unknown family test_tryopen: skip EACCES test when euid == 0 test/lib_read_write: account for larger-than-normal pipes test_poll: avoid potentially thread-unsafe test test_poll: preserve original trap(:USR1) handler test_poll: be less dependent on signal handler ordering Hleb Valoshka (4): Change prefix of temporary sockets to prevent races Don't dump 20M in case of failure Create own directory for every unix socket in unit tests Close tempfile and unlink it immediately.
TCP Fast Open in Linux 3.7 and later is now supported in the client via Kgio::Socket#kgio_fastopen. This release also adds the kgio_writev and kgio_trywritev methods, thanks to funny-falcon
Fix build for platforms lacking both TCP_CORK _and_ TCP_NOPUSH There are many test case fixes and cleanups, too.
Fixed build and autopush support under Debian GNU/kFreeBSD. Test case fixes for timing-sensitive tests.
Fix a missing #include for Ruby 1.8.5 users. No need to upgrade to this (nor 2.7.1) if you're on a modern version of Ruby.
This release fixes some compatibility issues with people stuck on older versions of Ruby/RubyGems. * define RARRAY_PTR/RARRAY_LEN macros for Ruby 1.8.6 * test/test_autopush: skip strace tests if not available * gemspec: disable development dependencies for old systems
When running under Ruby trunk/2.0.0dev, all IO objects created by kgio will be close-on-exec by default to match the (future) 2.0.0 behavior. accept()ed sockets in kgio have always been close-on-exec by default.. Singleton Kgio.accept_* methods are deprecated as the kgio_accept/kgio_tryaccept methods all take an additional flags argument. There are various, test, documentation, and error message improvements.
We now export SOCK_NONBLOCK, SOCK_CLOEXEC constants in the Kgio namespace to make kgio_tryaccept/kgio_accept easier-to-use. There are also some minor internal cleanups.
* Kgio::File.tryopen method added. It is like File.open but won't raise exceptions. The Kgio::File class includes Kgio::PipeMethods, so FIFOs opened through this get the kgio_* API. * The kgio_wait_*able methods in Kgio::DefaultWaiters now accept an optional timeout argument.
* adds -lnsl and -lsocket checks for OpenSolaris
This release fixes a race condition that could allow Errno::EINTR to be raised even though the 2.4.0 release was supposed to stop that. Nobody uses Kgio.poll, really, so this shouldn't be an issue for real code, yet.
== All supported platforms (*nix + MRI 1.8+, Rubinius) * OpenBSD (and possibly other *BSD) fixes, thanks to Jeremy Evans. * kgio_accept and kgio_tryaccept now take an optional second argument for flags (like the accept4() flags argument). == Ruby 1.9-only things * Kgio.poll no longer raises Errno::EINTR to match IO.select. == Ruby 1.9 trunk things * close() on an active FD in a different thread is better handled/detected. * copy-on-write for strings is properly triggered
We no longer over-allocate memory for Kgio.poll (1.9.x-only). Under Ruby 1.9.3dev, we also use rb_thread_io_blocking_region to properly deal with cross-thread IO#close.
Thanks to Jeremy Evans, this release fixes the build under OpenBSD.
* connect.c: disable AI_NUMERICSERV It's not needed since we already verify the service is a numeric port. AI_NUMERICSERV is not available in older glibc (<2.3.4) and probably other old systems.
recv() with MSG_PEEK for sockets is added with the try* interface. SocketMethods#kgio_trypeek and SocketMethods#kgio_peek or Kgio.trypeek for non-Kgio-enabled sockets. For Ruby 1.9 only: poll(2) is exposed via the Kgio.poll singleton method and should provide an alternative for IO.select users. Both of these new features should work well on modern Unix-like operating systems.
* sockets accept()ed by a TCP_NOPUSH/TCP_CORK listener automatically flush on kgio_*read calls if there is pending data. "Kgio.autopush = false" disables this globally, and Kgio::Socket also get "kgio_autopush=" to enable/disable on a per-object individual basis. * ECONNRESET exceptions get empty backtraces for kgio_*read. There's nothing a programmer can do about these, so there's no point in going through the expensive backtrace generation process. * Kgio.try* singleton methods added for working with non-Kgio enhanced objects. No more needing to use Object#extend and blowing away your method cache to make existing I/O objects kinder and gentler. * IPv6 support should be complete, systems without a native getaddrinfo(3) are now unsupported (and will remain so unless somebody complains). There should be no other backwards-incompatible changes other than requiring getaddrinfo(3) and friends for IPv6 support.
We now avoid errno side-effects in kgio_wait_*able methods. This affects Rubinius, but may affect other Ruby platforms (particularly those that use stdio) as well.
kgio_accept and kgio_tryaccept now take an optional argument to override the default Kgio::Socket class that is returned. These methods also fall back to using regular accept() if kgio was built on a system with accept4() and later run on a system without accept4().
(no code changes from 2.0.0pre1) This release should make Kgio easier and more consistent to use across a variety of libraries/applications. The global Kgio.wait_*able(=) accessor methods are gone in favor of having default kgio_wait_readable and kgio_wait_writable methods added to all Kgio-using classes. Sub-classes may (and are encouraged to) redefine these if needed. Eric Wong (7): expand Kgio::*#kgio_read! documentation prefer symbolic names for waiting read/writability EOFError message matches Ruby's README: Gemcutter => RubyGems.org update documentation with mailing list info add default kgio_wait_*able methods switch entirely to kgio_wait_*able methods
This release should make Kgio easier and more consistent to use across a variety of libraries/applications. The global Kgio.wait_*able(=) accessor methods are gone in favor of having default kgio_wait_readable and kgio_wait_writable methods added to all Kgio-using classes. Sub-classes may (and are encouraged to) redefine these if needed. Eric Wong (7): expand Kgio::*#kgio_read! documentation prefer symbolic names for waiting read/writability EOFError message matches Ruby's README: Gemcutter => RubyGems.org update documentation with mailing list info add default kgio_wait_*able methods switch entirely to kgio_wait_*able methods
kgio_read and kgio_tryread will now return an empty string when a length of zero is specified instead of nil (which would signal an EOF). This emulates the behavior of IO#read, IO#readpartial, IO#sysread, IO#read_nonblock in core Ruby for consistency.
* make Kgio::WaitWritable and Kgio::WaitReadable symbols * trywrite: fix stupid off-by-one error causing corrupt writes on retries
This fixes our accept4() wrapper which did not work as expected on some *BSD-based systems due to fcntl(fd, F_GETFL) returning false information. Linux 2.6+ users are unnaffected, including those without accept4(). Also some RDoc fixes.
The C extension is now split into several files for ease-of-maintenance. Slightly more common, client-triggerable exceptions (EOFError, Errno::EPIPE, Errno::ECONNRESET) are now less expensive as they are generated without backtraces.
* alternate classes may now be returned by accept/tryaccept by setting Kgio.accept_class=
* add compatibility for ancient Rubies (1.8.6) * linux: fix accept4() support for newer Linux
A kinder, gentler I/O library for Ruby
Generated with the Darkfish Rdoc Generator 2.