ChangeLog from http://bogomips.org/kgio.git commit 88ae3fb48de345a3a102ac4d17bb71e8a4691230 Author: Eric Wong Date: Tue Feb 15 08:55:25 2011 -0800 kgio 2.3.2 - OpenBSD build fix Thanks to Jeremy Evans, this release fixes the build under OpenBSD. commit 8556c2ccf64840a080a928312d8feed2834d4d29 Author: Jeremy Evans Date: Mon Feb 14 17:03:53 2011 -0800 Fix build on OpenBSD OpenBSD's getnameinfo(3) requires the sys/types.h header file, and including it should not cause a problem for other OSes. Acked-by: Eric Wong commit 6d19ebb3a917b566830f8d33e95b1eea2e99658d Author: Eric Wong Date: Sun Feb 13 16:50:13 2011 -0800 kgio 2.3.1 - compatibility fix * 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. commit b30aa658d7b4d946427119b23cfc264cc7172149 Author: Eric Wong Date: Sun Feb 13 16:33:29 2011 -0800 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. commit f74bcf37ed31611d14aba2d4b4518c6a3dea0f40 Author: Eric Wong Date: Wed Feb 9 10:10:36 2011 +0000 kgio 2.3.0 - MSG_PEEK and poll(2) support 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. commit 00d1bc89ed3811701195bf5ddb400a0a0067126f Author: Eric Wong Date: Tue Feb 8 14:11:45 2011 -0800 move poll support checks to kgio.h We may use poll elsewhere... commit 257b090af54e6a1cecd44325f8664c4c682a6740 Author: Eric Wong Date: Tue Feb 8 13:56:39 2011 -0800 pkg.mk: update to the latest * Fixes Ruby 1.9.3dev deprecation warnings * Fixes some documentation dependency issues * Allows RUBY_TEST_OPTS to be passed to unit tests commit d8616b605ad4d83b69e2679e1c210e476cc18e00 Author: Eric Wong Date: Tue Feb 8 13:50:55 2011 -0800 doc: fully RDoc all methods and classes Whee! commit 3f6bffb4c4297df48a69d146243fbe5ba8040cb5 Author: Eric Wong Date: Tue Feb 8 13:50:01 2011 -0800 doc: fix accept -> tryaccept copy+paste error Oops commit 823e8978b38dcfb642e5059e879af4209ebba0f1 Author: Eric Wong Date: Tue Feb 8 13:36:56 2011 -0800 README: fix download link/ref commit 5c480aee3067006b5da6d45b7de41d8401b70848 Author: Eric Wong Date: Tue Feb 8 10:41:51 2011 +0000 preliminary poll(2) support It's a nice alternative to IO.select for higher-numbered file descriptors, especially sparse ones. Our interface also generates less garbage than IO.select does. commit 47653194bf6ad53b9f5fca1b266c30855df5ebbd Author: Eric Wong Date: Sun Feb 6 21:56:35 2011 +0000 add support for recv() with MSG_PEEK Kgio.trypeek, kgio_trypeek and kgio_peek methods are added for using with sockets. commit 75a7da2bd757617995f5492df1205e4a3459618b Author: Eric Wong Date: Thu Feb 3 18:46:21 2011 -0800 kgio 2.2.0 - kinder, gentler I/O for the Internets * 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. commit c8fb5aa33262a455997ff6a57659a8d125f36d66 Author: Eric Wong Date: Thu Feb 3 14:28:11 2011 -0800 add SocketMethods#kgio_addr! This refreshes (or sets) the @kgio_addr ivar for sockets that didn't go through kgio_accept or kgio_tryaccept. commit cff0dd2f73acc73f721b2a589af9e37baedd2489 Author: Eric Wong Date: Wed Feb 2 13:56:31 2011 -0800 fix typos in ipv6 test case Oops, RTFE :P commit 17abe6ce8f01810022b948c71de0026b4ac89597 Author: Eric Wong Date: Wed Feb 2 21:33:28 2011 +0000 add proper IPv6 support No extra #ifdefs, we just won't support old systems without getaddrinfo() and friends anymore. I doubt anybody still has them... commit 879f2f0ee9133f34ec3e24141bdb4936e3408d3a Author: Eric Wong Date: Tue Feb 1 14:00:07 2011 -0800 avoid re-interning if GCC is not used (or under 1.8) Needless calls to rb_intern are wasteful in even semi-frequently used code. commit 499f158c74b7c455dca08fc30be88cb699ee24c6 Author: Eric Wong Date: Tue Feb 1 13:58:20 2011 -0800 kgio_*read: empty backtrace for ECONNRESET There's nothing a programmer can do about ECONNRESET so just make the exception cheaper to raise so it can still be logged. commit 36f69750cd69cbf892580da04be6675e23d92f6f Author: Eric Wong Date: Mon Jan 31 18:39:31 2011 -0800 add singleton methods for non-Kgio objects This allows people to more easily use Kgio in existing apps. commit 37e50a9a5fcd45242373379c0dc61ebf8ff609af Author: Eric Wong Date: Mon Jan 31 18:27:24 2011 -0800 autopush: enable accessors for client sockets Might as well allow clients to efficiently handle TCP_CORK/TCP_NOPUSH, too. commit d4773fc63a847119004c17a1b8803a815f99d98a Author: Eric Wong Date: Mon Jan 31 17:34:07 2011 -0800 autopush: enable this by default TCP_CORK (and presuably TCP_NOPUSH) aren't remotely useful in Rainbows! without this and there's almost no overhead for MRI, either. commit 8a1fc65c88dee174940735bb46074c72ac47ce61 Author: Eric Wong Date: Mon Jan 31 17:05:48 2011 -0800 autopush: optimize away ivar usage under MRI We know that all versions of MRI have a small RFile structure that is allocated in the same object slots as other Ruby types and also zeroed on allocation. This optimization enables us to fall back to using ivars in case MRI changes or if we're used on other Rubies. commit 6479b6d3934b8930910e0057f516aa019dd7a8c7 Author: Eric Wong Date: Mon Jan 31 15:18:33 2011 -0800 autopush: enable for TCP_NOPUSH under FreeBSD Hopefully it works for people who use TCP_NOPUSH... commit 15744a90cda72e9007914cd2a78b0b2949193479 Author: Eric Wong Date: Mon Jan 31 13:58:53 2011 -0800 autopush: simplify implementation and just use ivars Duh... commit 313d2bb8d37dbc5602e464def90b3e7fa9f60924 Author: Eric Wong Date: Mon Jan 31 13:03:02 2011 -0800 rename nopush_smart to autopush This is probably a better name for it, libautocork is a nice name even though we won't use it directly. commit 910f6f3df099c04fcd55bd6b20785cce69cb36ae Author: Eric Wong Date: Thu Jan 27 19:43:39 2011 -0800 preliminary implementation of "smart_nopush" It only supports TCP_CORK under Linux right now. We use a very basic strategy to use TCP_CORK semantics optimally in most TCP servers: On corked sockets, we will uncork on recv() if there was a previous send(). Otherwise we do not fiddle with TCP_CORK at all. Under Linux, we can rely on TCP_CORK being inherited in an accept()-ed client socket so we can avoid syscalls for each accept()-ed client if we already know the accept() socket corks. This module does NOTHING for client TCP sockets, we only deal with accept()-ed sockets right now. commit ec91ac3d8c8d9236ba0cd01794c9c4a3ee3f7eeb Author: Eric Wong Date: Thu Jan 27 14:11:16 2011 -0800 revamp packaging makefile, update URLs More common code that's still GNU make is better for my sanity. Also, bogomips.org went on a URL diet recently. commit f6c79438ed195bb706903d104cce850bfbfbac41 Author: Eric Wong Date: Tue Jan 18 15:52:25 2011 -0800 add tests for empty writes, too There could be some platforms that dislike it... commit 9c81cc3fd8d2b3dce68d69d8e0c56a4c5d89ebf0 Author: Eric Wong Date: Thu Jan 13 14:46:02 2011 -0800 Makefile: remove non-existent target reference Oops commit fb8104e1f2a5d1cdcb99a19b6a4bdabf0b1c2643 Author: Eric Wong Date: Sat Dec 25 18:06:47 2010 -0800 kgio 2.1.1 - one small Rubinius fix 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. commit 6ab4331f8137e949ab57f014f96ff3918a315044 Author: Eric Wong Date: Sat Dec 25 18:02:16 2010 -0800 avoid errno side-effects in kgio_wait_*able Retrieving the file descriptor may have side-effects on certain Ruby implementations (e.g. Rubinius), so ensure our errno is preserved before calling rb_io_wait_*able(). commit 3a0323b642ee054319a5e64ffe28e089bbd013e4 Author: Eric Wong Date: Sun Dec 26 01:08:58 2010 +0000 gemspec: point folks to the public mailing list It's more useful that way. commit 9d5c9e6c9975cb5c10e7384aed9ed22ae0ee57c8 Author: Eric Wong Date: Sun Dec 26 01:02:00 2010 +0000 kgio 2.1.0 - accept improvements and fixes 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(). commit dcd5eff7dd5d5861b67667f48424979be9bcabc8 Author: Eric Wong Date: Sun Dec 26 00:21:25 2010 +0000 quiet down some harmless compiler warnings Less noise means we'll notice real bugs sooner. commit 5280f35f131d88f90afffff0e10f7900530728aa Author: Eric Wong Date: Sat Dec 25 23:00:05 2010 +0000 accept4: fall back to regular accept() on ENOSYS kgio may occasionally be built on a system with accept4() and then deployed on one without it. Handle this case gracefully since it unfortunately happens on production systems. commit b859c4a12905cbd71d19cde2aaa9f88ec0374cc5 Author: Eric Wong Date: Sat Dec 25 22:44:53 2010 +0000 accept methods may take an optional argument This is preferred as we no longer have to rely on a global constant. commit ef069ece624906b3946248421620d8458bcef605 Author: Eric Wong Date: Fri Dec 24 09:21:19 2010 +0000 Rakefile: fix RAA license Oops, we were never Ruby licensed. commit 472240687caf3f113a3ff408729f8205c475d7d5 Author: Eric Wong Date: Fri Dec 24 09:20:40 2010 +0000 doc: use wrongdoc for documentation wrongdoc factors out a bunch of common code from this project into its own and removes JavaScript from RDoc to boot. commit 64bbc95d2192fb621b763c1c4d1ae32940c1a5ac Author: Eric Wong Date: Wed Dec 22 12:12:18 2010 -0800 fix errors in RDoc Noticed-by: IƱaki Baz Castillo commit f093312ad1ed336363f352991b6b99d96f7aed1d Author: Eric Wong Date: Thu Nov 18 17:16:53 2010 -0800 kgio 2.0.0 - major internal API changes (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 commit edfa7e60de5556b6abc9febe6a21e12dadbafd0b Author: Eric Wong Date: Thu Nov 18 15:42:27 2010 -0800 Rakefile: list prerelease tags as well Since we do prerelease nowadays before real ones. commit d78a2075bdb0a30bf0064d2857011c330cc0d09e Author: Eric Wong Date: Thu Nov 18 15:38:12 2010 -0800 move website to bogomips.org This project is useful enough for others and to stand alone without needing to be associated with Unicorn. commit 28070c522aff233eadb7e167f8d4e8122cd0bb47 Author: Eric Wong Date: Thu Nov 18 15:15:40 2010 -0800 kgio 2.0.0pre1 - major internal API changes 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 commit c69955e64648ab6a3471a54f7885a320428682f9 Author: Eric Wong Date: Thu Nov 18 14:37:05 2010 -0800 switch entirely to kgio_wait_*able methods This removes the global Kgio.wait_*able accesors and requires each class to define (or fall back to) the Kgio::DefaultWaiters methods. commit f1b497e601ed2acb54f75dc989d0a5ec7afebca0 Author: Eric Wong Date: Thu Nov 18 13:38:32 2010 -0800 add default kgio_wait_*able methods It makes it easier for people to use certain overrides without killing other methods. This is the first step in fixing problems people were having with dalli 0.11.1+ while running Unicorn. commit 827ad6b4fba768a5cac8fb4e83fbbf61cf7a3194 Author: Eric Wong Date: Mon Nov 15 10:33:55 2010 -0800 update documentation with mailing list info We're a real project, apparently, so it can have its own mailing list. commit fd88eae588c1e715dcaf3a1a000391cc13481e02 Author: Eric Wong Date: Mon Nov 15 10:22:49 2010 -0800 README: Gemcutter => RubyGems.org That's the new name for it and it's official commit 8615a3f9554df0fd7f7f088cd49cf1e3be49de9f Author: Eric Wong Date: Fri Nov 12 20:25:50 2010 -0800 EOFError message matches Ruby's This makes messages appear less different than Ruby when using kgio_read! Requested-by: Mike Perham commit 2772ed8bfe108b66b7493bc5cb0c40ddeb1ca57d Author: Eric Wong Date: Fri Nov 5 09:01:08 2010 +0800 prefer symbolic names for waiting read/writability There's no point in using constants that point to symbols instead of just the symbols themselves. commit bf3b507791403811bece9dff915ca10757bca519 Author: Eric Wong Date: Thu Oct 28 21:02:31 2010 +0000 expand Kgio::*#kgio_read! documentation If the author can forget why it was written, so can the rest of the world. commit f4d08a07a02393cca5ddd1277acc4f95c83307ff Author: Eric Wong Date: Fri Oct 8 14:55:16 2010 -0700 kgio 1.3.1 - fix zero-length reads 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. commit d225ede82d820d045bd7cfb826f444cf6601577c Author: Eric Wong Date: Fri Oct 8 02:53:38 2010 -0700 return empty string on length=0 This matches behavior of all the core Ruby methods. commit e4599227f0da0f652cbcb52838e631d7384dcd0d Author: Eric Wong Date: Thu Oct 7 20:02:40 2010 -0700 kgio 1.3.0 - bug and usability fixes * make Kgio::WaitWritable and Kgio::WaitReadable symbols * trywrite: fix stupid off-by-one error causing corrupt writes on retries commit f5fc35221d37141b0f72278c7b969211410e94c0 Author: Eric Wong Date: Thu Oct 7 20:00:09 2010 -0700 tests: don't trust what I think I know about Ruby case/when and === didn't actually work as I expected them to. commit 2152188f41bf2a5067e84a4404b48b2282a9dd55 Author: Eric Wong Date: Thu Oct 7 19:56:57 2010 -0700 trywrite: fix stupid off-by-one error causing corrupt writes Oops! commit c448ad898ecb7f354a32a320294da4727fc9af52 Author: Eric Wong Date: Thu Oct 7 19:55:49 2010 -0700 make WaitWritable and WaitReadable symbols This makes them easier to compare with === when used in case/when statements in Ruby commit 49f0b98c69f1f0bf637953d0bfc96b764f00ab9b Author: Eric Wong Date: Thu Oct 7 07:15:49 2010 +0000 kgio 1.2.1 - doc and *BSD workarounds 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. commit 03344bb763f5269afe7fafd56a47270719c7ef9e Author: Eric Wong Date: Thu Oct 7 07:14:07 2010 +0000 doc: fix RDoc generation Oops, completely broken by the splitting of the code. commit 637317eb479525dca543eda7a8977410bc43b832 Author: Eric Wong Date: Wed Oct 6 14:08:35 2010 -0700 accept4: workaround (P)OS X bug w/O_NONBLOCK Apparently fcntl(fd, F_GETFL) can return falsely return the O_NONBLOCK flag without actually having it set in the kernel. This is totally broken on the part of the OS. commit ca76c75f8a24d0cd6828fe16ca3790a277b35f8d Author: Eric Wong Date: Wed Oct 6 14:06:27 2010 -0700 build: pick on on modified extension files We build more than one file nowadays. commit 65f96b7750616bc210397c16eea40961e578a788 Author: Eric Wong Date: Wed Oct 6 11:51:04 2010 -0700 doc: fix typo in Kgio.accept_cloexec= doc oops... commit 414dd17f1009c571e2d7657721271756e3d4dd8e Author: Eric Wong Date: Tue Oct 5 16:09:40 2010 -0700 kgio 1.2.0 - cleanups and minor improvements 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. commit e085bb9600b190692beb5efc85656ebf127ae08c Author: Eric Wong Date: Tue Oct 5 15:45:16 2010 -0700 generate empty backtraces for EPIPE and ECONNRESET Malicious clients may disconnect during big writes to cause EPIPE and ECONNRESET exceptions. Generating backtraces can be expensive with Ruby, so mitigate the DoS vector by lowering the cost of generating an exception. commit b168cc894037620cab82fa82f3ab37a3aab81570 Author: Eric Wong Date: Tue Oct 5 15:26:57 2010 -0700 add kgio_read! methods which may raise EOFError Except EOFError is gently raised to not include a huge backtrace. Large backtraces can be a performance problem on busy servers that malicious clients may exploit to deny service. commit 870ada92db7071c7982913e508ac35b97d6e8761 Author: Eric Wong Date: Tue Oct 5 11:45:02 2010 -0700 GNUmakefile: use portable tar invocation We've been spoiled by GNU tar. commit 2a6115a89d5c95428bd6c3e0bc10e5a3a4c3c3be Author: Eric Wong Date: Wed Sep 29 18:25:58 2010 -0700 refactor and split into separate files Making the code easier to read and navigate. This also frees us from having to use the stupid A4_ prefix for accept4(2) flags since it conflicts with the socket(2) ones. commit 8fe89997453d6c530c3f5e08bc9c1da40a621248 Author: Eric Wong Date: Wed Sep 29 17:13:21 2010 -0700 Make kgio_trywrite more aggressive with retrying Partial writes can be retried until completely denied with EAGAIN. Often times, it is beneficial to retry immediately after a partial write because the kernel may allocate more buffers or the reader can drain the buffers. This helps the caller avoid crossing the Ruby <-> C boundary more than necessary. commit 39c851e595970a2349a8a39878afd94a3324e102 Author: Eric Wong Date: Tue Sep 28 18:16:53 2010 -0700 kgio 1.1.0 - flexible accept methods * an alternate class now be returned by accept/tryaccept by setting "Kgio.accept_class =" commit 911f6ab306aff1e24c9c570eeae33923fa1b99d9 Author: Eric Wong Date: Tue Sep 28 18:04:51 2010 -0700 alternate classes may be returned by accept/tryaccept These can be useful for avoiding wrapper objects and also allows users to more easily try different things without stepping on others' toe^H^H^Hclasses. commit 526b4bd48a20a34ef5959fdc4aa580d5f9199652 Author: Eric Wong Date: Mon Sep 27 19:59:34 2010 -0700 kgio 1.0.1 - compatibility fixes * add compatibility for ancient Rubies (1.8.6) * linux: fix accept4() support for newer Linux commit 20cbc0355104470fb433dd13e87a5d5c7e888ab1 Author: Eric Wong Date: Tue Sep 28 02:56:41 2010 +0000 linux: fix accept4() support for newer Linux Oops :x Tested on Debian sid. commit 24f1d168eb0937f0586c45b266bcd208431f0107 Author: Eric Wong Date: Mon Sep 27 18:06:34 2010 -0700 add compatibility for ancient Rubies This is tested on Ruby 1.8.6-p114, but may work for 1.8.5, too. Ugh, people ought to upgrade. commit e4d204c86e9420023ba3e4d8dbeb6b3fea8d6cf7 Author: Eric Wong Date: Tue Sep 28 00:27:44 2010 +0000 kgio 1.0.0 - initial release Documentation and release infrastructure updates and such... commit 8984b9556a3493570fbb4f747fce712d58f2cdd8 Author: Eric Wong Date: Tue Sep 28 00:07:43 2010 +0000 doc: TODO update commit 2c64a1fc07d3b9a80d112e3b0e2baa7ec29c2f47 Author: Eric Wong Date: Tue Sep 28 00:03:39 2010 +0000 read/write: account for buffer changes during wait It's possible for applications to modify the buffer during reads and writes, so make a best effort to account for those. commit f2ea9918655e8ee0576bee2950d16485031fc361 Author: Eric Wong Date: Mon Sep 27 23:59:59 2010 +0000 tests: fix broken monster trywrite test Oops, use random data so it's easier to detect this. commit 7abc0eb3dd804c2e65660b7dd9c828df0e03b80a Author: Eric Wong Date: Mon Sep 27 15:09:44 2010 -0700 test_tcp*read_write: use blocking kgio_accept in setup Some OSes (FreeBSD 7.0) do not seem to setup connections as quickly. commit 95d2eae6a4da34c504427af6ae0ab4c8c70c0ce5 Author: Eric Wong Date: Mon Sep 27 15:09:43 2010 -0700 set blocking flag before blocking IO#read Some older Rubies may not behave correctly otherwise commit 0806cac89f9d0e169b6c1e4da68c1ad66daa23ae Author: Eric Wong Date: Mon Sep 27 23:16:53 2010 +0000 tess: ensure buffer is cleared on failures No need to leak data. commit 50b86bf23063f3e6c3777b39c9464f73ccfd6ef5 Author: Eric Wong Date: Mon Sep 27 22:55:52 2010 +0000 more documentation Somebody's gotta do it... commit 5123d66fe0b2dad67539a20fe5b91f5b9afd814a Author: Eric Wong Date: Mon Sep 27 16:56:13 2010 +0000 avoid initiating syscalls before rb_io_wait_* Some Ruby implementations (Rubinius) may call lseek and clobber the intended errno when looking up the open file, causing rb_io_wait_* functions to fail. commit 6c818b0b6f76ef733679bcea1024142b4ef3ce00 Author: Eric Wong Date: Mon Sep 27 01:13:30 2010 +0000 add kgio_tryaccept, kgio_accept _really_ blocks We'll stick with the "try" prefix if we're going to be non-blocking. kgio_accept will favor a blocking accept() call where it's possible to release the GVL, allowing it to avoid thundering herd problems. Otherwise it'll use thread-safe blocking under Ruby 1.8. commit f81cb3c05a0eb46ec61ceb295b51ead16e6a0da4 Author: Eric Wong Date: Mon Sep 27 00:57:14 2010 +0000 use SOCK_NONBLOCK for socket(2) if possible This saves us a relatively expensive fcntl() system call. commit 87cf3ce6185b9138032a5af53cecae98f8c93564 Author: Eric Wong Date: Mon Sep 27 00:24:50 2010 +0000 connect: no do not leak descriptors on failure We cannot raise exceptions and expect GC to clean up after us until we've created an actual IO object. commit 6fbde1518578dd1b828efcecaf2caf893bddc110 Author: Eric Wong Date: Mon Sep 27 00:11:43 2010 +0000 "start" singleton methods for non-blocking connect These initiate (but do not wait for) non-blocking connects. commit fdfecc6d815bab8dfc1d8ad6758a66d44ab51e31 Author: Eric Wong Date: Sun Sep 26 07:51:12 2010 +0000 introduce kgio_try* methods Avoid altering behavior based on globals that Kgio.wait_{read,writ}able stored in, since that's too confusing. The non-try variants are closer to the normal IO read/write methods, except they can be more easily plugged into alternate reactors and event frameworks. commit d8ee79e1e5c6e6908009213324db25cf41c583ce Author: Eric Wong Date: Sat Sep 25 17:55:07 2010 +0000 kgio_read returns nil on EOF Just like IO#read commit af03e4471de3d3b91eec16e26e93a84d4a717116 Author: Eric Wong Date: Sat Sep 25 17:47:13 2010 +0000 split out reusable bits into separate headers No point in cluttering up the meat of our code. commit db53263856d864ba6273e6cac73011f699509d71 Author: Eric Wong Date: Sat Sep 25 01:36:13 2010 -0700 only use MSG_DONTWAIT under Linux MSG_DONTWAIT is less consistently implemented/supported on other platforms on stream sockets, so fallback to fcntl() + read()/write() for stream sockets. This also fixes our previously broken support of non-MSG_DONTWAIT systems. commit a82dc40c2a509c4ab692da34b572693f243fbfae Author: Eric Wong Date: Sat Sep 25 01:36:12 2010 -0700 write/send may fail with ECONNRESET Tested on FreeBSD 7.0 commit 0c60192621303f5e4ebd46d43a058de48126bc8a Author: Eric Wong Date: Sat Sep 25 01:36:11 2010 -0700 fix missing netinet/in.h include This is needed for FreeBSD 7.0, at least. commit 0beb82437f4ab0b8422e225080b234361092315e Author: Eric Wong Date: Sat Sep 25 08:15:13 2010 +0000 beef up the test suite We need to test server <-> client interaction more thoroughly since some systems don't implement everything right. commit 460e6b025896dee64b39d194d4c1a536129654de Author: Eric Wong Date: Thu Sep 23 22:56:44 2010 +0000 initial commit + release everything shou^Wmight be working...