]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/IMAP.pm
imap: stop_idle: fix parameter parsing :x
[public-inbox.git] / lib / PublicInbox / IMAP.pm
index 9ae7c60e75ee161eb276b23d750fa65c4ea9a7ce..373bffc18d9ade459410155abf93ce77194c02be 100644 (file)
@@ -351,7 +351,7 @@ sub cmd_idle ($$) {
 }
 
 sub stop_idle ($$) {
-       my ($self, $ibx);
+       my ($self, $ibx) = @_;
        my $sock = $self->{sock} or return;
        my $fd = fileno($sock);
        delete $IDLERS->{$fd};
@@ -1462,6 +1462,10 @@ sub cmd_starttls ($$) {
 # for graceful shutdown in PublicInbox::Daemon:
 sub busy {
        my ($self, $now) = @_;
+       if (defined($self->{-idle_tag})) {
+               $self->write(\"* BYE server shutting down\r\n");
+               return; # not busy anymore
+       }
        ($self->{rbuf} || $self->{wbuf} || $self->not_idle_long($now));
 }