sub auth_challenge_ok ($) {
my ($self) = @_;
my $tag = delete($self->{-login_tag}) or return;
+ $self->{anon} = 1;
login_success($self, $tag);
}
$self->msg_more(")\r\n");
}
+sub requeue { # overrides PublicInbox::DS::requeue
+ my ($self) = @_;
+ if ($self->{anon}) { # AUTH=ANONYMOUS gets high priority
+ $self->SUPER::requeue;
+ } else { # low priority
+ push(@{$self->{imapd}->{-authed_q}}, $self) == 1 and
+ PublicInbox::DS::requeue($self->{imapd});
+ }
+}
+
sub fetch_blob_cb { # called by git->cat_async via ibx_async_cat
my ($bref, $oid, $type, $size, $fetch_arg) = @_;
my ($self, undef, $msgs, $range_info, $ops, $partial) = @$fetch_arg;
$smsg->{blob} eq $oid or die "BUG: $smsg->{blob} != $oid";
}
my $pre;
- if (!$self->{wbuf} && (my $nxt = $msgs->[0])) {
- $pre = ibx_async_prefetch($ibx, $nxt->{blob},
+ ($self->{anon} && !$self->{wbuf} && $msgs->[0]) and
+ $pre = ibx_async_prefetch($ibx, $msgs->[0]->{blob},
\&fetch_blob_cb, $fetch_arg);
- }
fetch_run_ops($self, $smsg, $bref, $ops, $partial);
$pre ? $self->dflush : $self->requeue_once;
}
# callback used by PublicInbox::DS for any (e)poll (in/out/hup/err)
sub event_step {
my ($self) = @_;
-
+ local $SIG{__WARN__} = $self->{imapd}->{warn_cb};
return unless $self->flush_write && $self->{sock} && !$self->{long_cb};
# only read more requests if we've drained the write buffer,