Changeset 765

Show
Ignore:
Timestamp:
03/09/08 03:44:49 (21 months ago)
Author:
bradfitz
Message:

on successful write, update Perlbal::Socket's alive_time, so slowly
reproxied writes don't timeout the connection and kill it. Patch
from Jonty <jonty@…>. r765

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGES

    r764 r765  
     1    -- on successful write, update Perlbal::Socket's alive_time, so slowly 
     2       reproxied writes don't timeout the connection and kill it.  Patch 
     3       from Jonty <jonty@last.fm>.  r765 
     4 
    15    -- Perl 5.10 support.  Patch from Andy Armstrong <andy@hexten.net>. 
    26       Disclaimer: at least the tests all pass now, but no real-world use yet. 
  • trunk/lib/Perlbal/Socket.pm

    r752 r765  
    302302} 
    303303 
     304### METHOD: write() 
     305### Overridden from Danga::Socket to update our alive time on successful writes 
     306### Stops sockets from being closed on long-running write operations 
     307sub write { 
     308    my $self = shift; 
     309 
     310    my $ret; 
     311    if ($ret = $self->SUPER::write(@_)) { 
     312        # Mark this socket alive so we don't time out 
     313        $self->{alive_time} = $Perlbal::tick_time; 
     314    } 
     315     
     316    return $ret; 
     317} 
     318 
    304319### METHOD: close() 
    305320### Set our state when we get closed.