]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ds: flush_write: early return on closed socket
authorEric Wong <e@yhbt.net>
Tue, 23 Jun 2020 18:09:06 +0000 (18:09 +0000)
committerEric Wong <e@yhbt.net>
Thu, 25 Jun 2020 06:41:46 +0000 (06:41 +0000)
This quiets warnings from IMAP::fetch_blob (called via
long_response) failing to access `$self->{ibx}->git'
because ->{ibx} gets deleted by IMAP::close.

lib/PublicInbox/DS.pm

index b7753e1a663148320e798aa606bfe0af1e9d4f7d..aa65b2d364259d97003f3c4b83b79b301c4003f7 100644 (file)
@@ -421,8 +421,8 @@ sub epbit ($$) { # (sock, default)
 # returns 1 if done, 0 if incomplete
 sub flush_write ($) {
     my ($self) = @_;
+    my $sock = $self->{sock} or return;
     my $wbuf = $self->{wbuf} or return 1;
-    my $sock = $self->{sock};
 
 next_buf:
     while (my $bref = $wbuf->[0]) {