This version was released on 2002-01-03.

Happy Gregorian new year!

Gabriel Kihlman found a memory leak while running thrash.perl. It turned out to be an ID leak in POE::Wheel. free_wheel_id() was not properly deleting destroyed wheel IDs. Rocco fixed it.

Rocco removed a silly reference from Wheel::ReadWrite while he was tracking down Gabriel Kihlman's memory leak.

Rocco added a constant to thrash.perl while tracking down Gabriel Kihlman's memory leak. The number of simultaneous clients can be controlled cleaner.

Rocco added filehandle leak detection to thrash.perl while tracking down Gabriel Kihlman's memory leak.

Rocco added dummy event handlers for various sessions in thrash.perl. This cleaned up the warnings when ASSERT_DEFAULT was turned on while tracking down Gabriel Kihlman's memory leak.

Luis Henrique Fagundes found a typo in samples/tutorial-chat.perl. Rocco corrected it.

Rocco refactored POE::Kernel's filehandle watcher data structures and the related code that maintains them. It's still raw code; there's plenty of room for cleanup, but it passes POE's test suite. This touches POE::Kernel.pm, and POE::Kernel::*.pm, but no public interfaces have changed.

may break code: Rocco made select (filehandle watcher) events post through the queue instead of calling their handlers immediately. Watchers are paused until their queued events are dispatched, preventing redundant events from clogging up the queue. This change is not really expected to break anything, but it does change the way POE's public interface works.

Rocco added code to _internal_select() that removes any events from a filehandle whatcher when the watcher is being removed. This fixes the last little problem with enqueued events, and new style watchers should behave just like the old ones. Filehandle watchers, not, you know, the Old Ones.

Rocco added the newer wheels to t/00_coverage.t.

Rocco updated POE::Kernel's and POE::Session's documentation to remove mentions of "synchronous" or "immediate" filehandle watcher events.

Rocco finally added pause_input() and resume_input() to POE::Wheel::ReadWrite. Torvald Riegel will either be incredibly relieved or intensely dismayed at this and the other input changes in this version.

Ben Laurie reported that Tk programs don't stop when they die. Rocco added a Tk::Error handler that explains the error and emits SIGUIDESTROY (fictitious) when an error is caught. Programs should stop now, although it may not be proper behavior in all circumstances.

Ben Laurie reported that POE's child process reaper is slow. Rocco added TRACE_SIGNALS to enable a STDERR log of signal polling activity.

Ben Laurie reported that POE's child process reaper is slow because of queue latency between reap checks. He provided a patch placing waitpid(2) in a loop so the CHLD signals queued up will be reaped at once. Rocco applied it. Ben's report:

  I found that the enclosed patch solves the problem - it seems it
  simply doesn't poll often enough. Note that with this patch it picks
  up 3-10 children on each poll! Also note that the machine is 100%
  loaded for most of the time my stuff is running, with a load average
  of 8 or so (I actually run up to 30 subprocesses in parallel in this
  test).

  Without the patch after the first few polls it always polls
  "immediately" for the whole of the rest of the run - its just that
  "immediately" tends not to be very immediate (.5-1 second), hence
  the problem.

Rocco applied freeside's samples/proxy.perl patch to allow hyphens in hostnames.

Rocco made Driver::SysRW the default driver for Wheel::FollowTail and Wheel::ReadWrite.

Rocco made Filter::Line the default filter for Wheel::FollowTail and Wheel::ReadWrite.

Rocco added code to t/06_tk.t to test Wheel::ReadWrite with either a default driver or a default filter.

Rocco added code to t/07_event.t to test Wheel::ReadWrite with a default driver and filter together.

Rocco fixed t/08_errors.t to skip Filter::HTTPD tests if the filter's prerequisites are missing.

Fletch reported that t/19_filterchange.t was failing if Storable and FreezeThaw weren't installed. Rocco added a couple missing MyOtherFreezer references.

Rocco added code to Filter::HTTPD's "Did not want any more data" error. Now it dumps the data it didn't want.

Ann Barcomb wrote SimpleSocket, a high-level wrapper for SocketFactory and ReadWrite as a combined server. She donated her work to POE's Server::TCP component, but the callback schemes turned out to be incompatible. Rocco extended POE::Component::Server::TCP with her ideas, but he could not make it work the way she envisioned.

Rocco also wrote POE::Component::Client::TCP based on Ann's ideas from SimpleSocket. It too is more POE than Simple.

Rocco wrote t/26_comp_tcp.t to test the Server and Client TCP components.

Miroslav Madzarevic found a race condition in samples/proxy.perl where proxy sessions would not shut down properly on an error. Rocco applied his fix.

Sungo needed signals with extra parameters. Rocco patched POE::Kernel's signal() method to pass them on.

Sungo reported that POE::Preprocessor causes perl to spew a slew of unhelpful errors on an undefined macro warning. He suggested removing the macro definition and making the warning more robust. Rocco decided that removing the macro would cause other unrelated errors, so he patched Preprocessor to die instead.

Rocco credited more people in POE.pm.

SciFi is trying to install POE on Windows. A new POSIX constant doesn't exist: EADDRNOTAVAIL. Rocco defined it in the modules that use it.

Jason Boxman discovered that Filter::HTTPD blindly prepends "HTTP/1.0" to response headers. Rocco fixed it so the protocol defaults to HTTP/1.0, and prepending it isn't necessary anymore.

Jason Boxman also found out that Filter::HTTPD does not play nicely with the latest LWP. It turned out that URI::URL is deprecated. Rocco fixed Filter::HTTPD to use URI directly instead.

Rocco updated t/08_errors.t so it doesn't crash on Windows. Thanks to Jonathan Steinert for loaning a shell on a Windows 2000 machine to test POE.

Rocco discovered the true cause of the signal() redefine warning in POE::Kernel (POSIX signal_h imports) and fixed it.

Test 14 was blowing up on Windows because select() was being called without file descriptor bits. Rocco fixed it.

Morbus Iff is testing POE on MacPerl. It never got past Makefile.PL, though. Chris Nandor pointed out that "exit 0" at the end is stopping his installer's "do Makefile.PL". Rocco applied his "unless $^O eq 'MacOS'" suggestion to Makefile.PL.

Jason Boxman is using Driver::SysRW directly, and it's not documented very well. Patch Driver.pm to discuss flush()'s method of returning errors.

Apply various fixes to Wheel::Run to make it work better on Windows.

Freeside discovered a nasty bug where sessions wouldn't always self-destruct, especially when using closures to push postbacks into a session's event handlers. The fix was to add a very small garbage collection check in POE::Kernel's event dispatcher.

Dynweb noticed that Win32 machines return negative PIDs and the sanity check in POE::Kernel was failing because it expected positive PIDs. Rocco fixed the check to expect negative PIDs on Win32 systems.

Added warnings when trying to use _xyz (underscore-led) event names from userland code. Some people may think posting _stop will stop a session, but it doesn't. These warnings are only enabled when ASSERT_USAGE is set.

Rocco set slave ptys' window sizes to match STDIN's, in Wheel::Run. ssh was propagating a null window size to Solaris, which was being rather strict about it.

Rocco added precision to TRACE_SELECT and TRACE_EVENTS times so all the significant digits for millisecond times would show.

Rocco added more output for TRACE_SIGNALS. Linux users are reporting hangs in select() when their programs catch signals.

Rocco increased Client::TCP and Server::TCP's read/write block size to 4KB.

Rocco fixed a stupid closure trick in Server::TCP that made every client session use the same filter instance. Thanks to freeside for finding this one and providing a beautiful test case.

may break code: Rocco removed the experimental synchronous stuff from POE::NFA. There is a slight chance that this may break backward compatibility in programs that use POE::NFA.

Back to POE CHANGES.