ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/syncmail/vc.pm
(Generate patch)

Comparing syncmail/vc.pm (file contents):
Revision 1.1 by root, Sat Oct 27 23:53:49 2001 UTC vs.
Revision 1.2 by root, Sun Oct 28 03:51:24 2001 UTC

5use Coro; 5use Coro;
6use Coro::Event; 6use Coro::Event;
7use Coro::Channel; 7use Coro::Channel;
8 8
9BEGIN { *slog = \&::slog } 9BEGIN { *slog = \&::slog }
10
11$MAXMSG = 1024;
12 10
13use constant MAXMSG => 1024; 11use constant MAXMSG => 1024;
14use constant MAXQ => 10; 12use constant MAXQ => 10;
15 13
16my @send; 14my @send;
29} 27}
30 28
31sub new_passive { 29sub new_passive {
32 my $class = shift; 30 my $class = shift;
33 my $self = bless { 31 my $self = bless {
34 rcv => (new Coro::Channel 100), 32 rcv => (new Coro::Channel 1e9),
35 @_, 33 @_,
36 }, $class; 34 }, $class;
37 35
38 weaken ($port[$self->{port}] = $self); 36 weaken ($port[$self->{port}] = $self);
39 $self; 37 $self;
71 my $self = shift; 69 my $self = shift;
72 70
73 $send_empty->wait while @send > MAXQ; 71 $send_empty->wait while @send > MAXQ;
74 72
75 for (@_) { 73 for (@_) {
76 slog 8, ">>> :$vc->{port} ".dumpstr($_)."\n"; #d# 74 slog 8, ">>> :$self->{port} ".dumpstr($_)."\n"; #d#
77 push @{$send[$self->{pri}]}, 75 push @{$send[$self->{pri}]},
78 pack "nna*", $self->{port}, length $_, $_; 76 pack "nna*", $self->{port}, length $_, $_;
79 } 77 }
80 78
81 $send_full->send; 79 $send_full->send;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines