Date | Commit message (Collapse) |
|
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 removes the global Kgio.wait_*able accesors and requires
each class to define (or fall back to) the Kgio::DefaultWaiters
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.
|
|
We're a real project, apparently, so it can have its
own mailing list.
|
|
That's the new name for it and it's official
|
|
This makes messages appear less different than Ruby
when using kgio_read!
Requested-by: Mike Perham
|
|
There's no point in using constants that point to symbols
instead of just the symbols themselves.
|
|
If the author can forget why it was written, so can
the rest of the world.
|
|
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.
|
|
This matches behavior of all the core Ruby methods.
|
|
* make Kgio::WaitWritable and Kgio::WaitReadable symbols
* trywrite: fix stupid off-by-one error causing corrupt writes
on retries
|
|
case/when and === didn't actually work as I expected
them to.
|
|
Oops!
|
|
This makes them easier to compare with === when used
in case/when statements in Ruby
|
|
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.
|
|
Oops, completely broken by the splitting of the code.
|
|
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.
|
|
We build more than one file nowadays.
|
|
oops...
|
|
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.
|
|
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.
|
|
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.
|
|
We've been spoiled by GNU tar.
|
|
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.
|
|
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.
|
|
* an alternate class now be returned by accept/tryaccept
by setting "Kgio.accept_class ="
|
|
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.
|
|
* add compatibility for ancient Rubies (1.8.6)
* linux: fix accept4() support for newer Linux
|
|
Oops :x Tested on Debian sid.
|
|
This is tested on Ruby 1.8.6-p114, but may work
for 1.8.5, too. Ugh, people ought to upgrade.
|
|
Documentation and release infrastructure updates
and such...
|
|
|
|
It's possible for applications to modify the buffer during
reads and writes, so make a best effort to account for those.
|
|
Oops, use random data so it's easier to detect this.
|
|
Some OSes (FreeBSD 7.0) do not seem to setup
connections as quickly.
|
|
Some older Rubies may not behave correctly otherwise
|
|
No need to leak data.
|
|
Somebody's gotta do it...
|
|
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.
|
|
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.
|
|
This saves us a relatively expensive fcntl() system call.
|
|
We cannot raise exceptions and expect GC to clean up
after us until we've created an actual IO object.
|
|
These initiate (but do not wait for) non-blocking connects.
|
|
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.
|
|
Just like IO#read
|
|
No point in cluttering up the meat of our code.
|
|
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.
|
|
Tested on FreeBSD 7.0
|
|
This is needed for FreeBSD 7.0, at least.
|
|
We need to test server <-> client interaction
more thoroughly since some systems don't implement
everything right.
|