… | |
… | |
903 | @_ = ($WH{$type} ||= _load_func "$type\::anyevent_write_type" |
903 | @_ = ($WH{$type} ||= _load_func "$type\::anyevent_write_type" |
904 | or Carp::croak "unsupported/unloadable type '$type' passed to AnyEvent::Handle::push_write") |
904 | or Carp::croak "unsupported/unloadable type '$type' passed to AnyEvent::Handle::push_write") |
905 | ->($self, @_); |
905 | ->($self, @_); |
906 | } |
906 | } |
907 | |
907 | |
|
|
908 | # we downgrade here to avoid hard-to-track-down bugs, |
|
|
909 | # and diagnose the problem earlier and better. |
|
|
910 | |
908 | if ($self->{tls}) { |
911 | if ($self->{tls}) { |
909 | $self->{_tls_wbuf} .= $_[0]; |
912 | utf8::downgrade $self->{_tls_wbuf} .= $_[0]; |
910 | &_dotls ($self) if $self->{fh}; |
913 | &_dotls ($self) if $self->{fh}; |
911 | } else { |
914 | } else { |
912 | $self->{wbuf} .= $_[0]; |
915 | utf8::downgrade $self->{wbuf} .= $_[0]; |
913 | $self->_drain_wbuf if $self->{fh}; |
916 | $self->_drain_wbuf if $self->{fh}; |
914 | } |
917 | } |
915 | } |
918 | } |
916 | |
919 | |
917 | =item $handle->push_write (type => @args) |
920 | =item $handle->push_write (type => @args) |