-use constant MSG_MORE => ($^O eq 'linux') ? 0x8000 : 0;
-sub more ($$) {
- my $self = $_[0];
- if (MSG_MORE && !$self->{write_buf_size}) {
- my $n = send($self->{sock}, $_[1], MSG_MORE);
- if (defined $n) {
- my $dlen = length($_[1]);
- return 1 if $n == $dlen; # all done!
- $_[1] = substr($_[1], $n, $dlen - $n);
- # fall through to normal write:
- }
- }
- $self->write($_[1]);
-}
-
-# overrides existing Danga::Socket method
-sub event_write {
- my ($self) = @_;
- # only continue watching for readability when we are done writing:
- return if $self->write(undef) != 1;
-
- if ($self->{rbuf} eq '') { # wait for next request
- $self->watch_read(1);
- } else { # avoid recursion for pipelined requests
- push @$pipelineq, $self;
- $pipet ||= PublicInbox::EvCleanup::asap(*process_pipelineq);
- }