ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/Handle.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/Handle.pm (file contents):
Revision 1.198 by root, Tue Aug 31 01:03:37 2010 UTC vs.
Revision 1.199 by root, Mon Oct 11 03:41:39 2010 UTC

558 $self->oobinline (exists $self->{oobinline} ? delete $self->{oobinline} : 1); 558 $self->oobinline (exists $self->{oobinline} ? delete $self->{oobinline} : 1);
559 559
560 $self->starttls (delete $self->{tls}, delete $self->{tls_ctx}) 560 $self->starttls (delete $self->{tls}, delete $self->{tls_ctx})
561 if $self->{tls}; 561 if $self->{tls};
562 562
563 $self->on_drain (delete $self->{on_drain}) if $self->{on_drain}; 563 $self->on_drain (delete $self->{on_drain} ) if $self->{on_drain};
564 564
565 $self->start_read 565 $self->start_read
566 if $self->{on_read} || @{ $self->{_queue} }; 566 if $self->{on_read} || @{ $self->{_queue} };
567 567
568 $self->_drain_wbuf; 568 $self->_drain_wbuf;
1271 $self->_drain_rbuf if $cb; 1271 $self->_drain_rbuf if $cb;
1272} 1272}
1273 1273
1274=item $handle->rbuf 1274=item $handle->rbuf
1275 1275
1276Returns the read buffer (as a modifiable lvalue). 1276Returns the read buffer (as a modifiable lvalue). You can also access the
1277read buffer directly as the C<< ->{rbuf} >> member, if you want (this is
1278much faster, and no less clean).
1277 1279
1278You can access the read buffer directly as the C<< ->{rbuf} >> 1280The only operation allowed on the read buffer (apart from looking at it)
1279member, if you want. However, the only operation allowed on the 1281is removing data from its beginning. Otherwise modifying or appending to
1280read buffer (apart from looking at it) is removing data from its 1282it is not allowed and will lead to hard-to-track-down bugs.
1281beginning. Otherwise modifying or appending to it is not allowed and will
1282lead to hard-to-track-down bugs.
1283 1283
1284NOTE: The read buffer should only be used or modified if the C<on_read>, 1284NOTE: The read buffer should only be used or modified in the C<on_read>
1285C<push_read> or C<unshift_read> methods are used. The other read methods 1285callback or when C<push_read> or C<unshift_read> are used with a single
1286automatically manage the read buffer. 1286callback (i.e. untyped). Typed C<push_read> and C<unshift_read> methods
1287will manage the read buffer on their own.
1287 1288
1288=cut 1289=cut
1289 1290
1290sub rbuf : lvalue { 1291sub rbuf : lvalue {
1291 $_[0]{rbuf} 1292 $_[0]{rbuf}
1342 my $cb = pop; 1343 my $cb = pop;
1343 1344
1344 if (@_) { 1345 if (@_) {
1345 my $type = shift; 1346 my $type = shift;
1346 1347
1348 $cb = ($RH{$type} ||= _load_func "$type\::anyevent_read_type"
1347 $cb = ($RH{$type} or Carp::croak "unsupported type passed to AnyEvent::Handle::unshift_read") 1349 or Carp::croak "unsupported/unloadable type '$type' passed to AnyEvent::Handle::unshift_read")
1348 ->($self, $cb, @_); 1350 ->($self, $cb, @_);
1349 } 1351 }
1350 1352
1351 unshift @{ $self->{_queue} }, $cb; 1353 unshift @{ $self->{_queue} }, $cb;
1352 $self->_drain_rbuf; 1354 $self->_drain_rbuf;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines