]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
treewide: kill problematic "$h->{k} //= do {" assignments
[public-inbox.git] / lib / PublicInbox / LEI.pm
index f9d24f29c87d0dfc82056c8b767b64ca05c8a46b..3e1706a0dd20258508666db347f85e75aee8d344 100644 (file)
@@ -130,9 +130,10 @@ sub url_folder_cache {
 
 sub ale {
        my ($self) = @_;
-       $self->{ale} //= do {
+       $self->{ale} // do {
                require PublicInbox::LeiALE;
-               $self->_lei_cfg(1)->{ale} //= PublicInbox::LeiALE->new($self);
+               my $cfg = $self->_lei_cfg(1);
+               $self->{ale} = $cfg->{ale} //= PublicInbox::LeiALE->new($self);
        };
 }
 
@@ -202,7 +203,7 @@ our %CMD = ( # sorted in order of importance/use:
 
 'mail-diff' => [ '--stdin|LOCATION...', 'diff the contents of emails',
        'stdin|', # /|\z/ must be first for lone dash
-       qw(verbose|v+ color:s no-color raw-header),
+       qw(verbose|v+ in-format|F=s color:s no-color raw-header),
        @diff_opt, @net_opt, @c_opt ],
 
 'add-external' => [ 'LOCATION',
@@ -1127,7 +1128,7 @@ sub event_step {
        local %ENV = %{$self->{env}};
        local $current_lei = $self;
        eval {
-               my @fds = $recv_cmd->($self->{sock}, my $buf, 4096);
+               my @fds = $recv_cmd->($self->{sock} // return, my $buf, 4096);
                if (scalar(@fds) == 1 && !defined($fds[0])) {
                        return if $! == EAGAIN;
                        die "recvmsg: $!" if $! != ECONNRESET;
@@ -1159,10 +1160,10 @@ sub event_step {
 sub event_step_init {
        my ($self) = @_;
        my $sock = $self->{sock} or return;
-       $self->{-event_init_done} //= do { # persist til $ops done
+       $self->{-event_init_done} // do { # persist til $ops done
                $sock->blocking(0);
                $self->SUPER::new($sock, EPOLLIN);
-               $sock;
+               $self->{-event_init_done} = $sock;
        };
 }