--- AnyEvent/lib/AnyEvent.pm 2005/12/04 09:44:32 1.5 +++ AnyEvent/lib/AnyEvent.pm 2005/12/19 17:03:29 1.6 @@ -185,7 +185,7 @@ and !$!{EINPROGRESS} and Carp::croak "unable to connect: $!\n"; -Then it creates a write-watcher which gets called wehnever an error occurs +Then it creates a write-watcher which gets called whenever an error occurs or the connection succeeds: $txn->{w} = AnyEvent->io (fh => $txn->{fh}, poll => 'w', cb => sub { $txn->fh_ready_w }); @@ -212,6 +212,7 @@ if (end-of-file or data complete) { $txn->{result} = $txn->{buf}; $txn->{finished}->broadcast; + $txb->{cb}->($txn) of $txn->{cb}; # also call callback } The C method, finally, just waits for the finished signal (if the @@ -219,7 +220,7 @@ data: $txn->{finished}->wait; - return $txn->{buf}; + return $txn->{result}; The actual code goes further and collects all errors (Cs, exceptions) that occured during request processing. The C method detects