-sub new ($$$) {
- my ($class, $sock, $imapd) = @_;
- my $self = bless { imapd => $imapd }, 'PublicInbox::IMAP_preauth';
- my $ev = EPOLLIN;
- my $wbuf;
- if ($sock->can('accept_SSL') && !$sock->accept_SSL) {
- return CORE::close($sock) if $! != EAGAIN;
- $ev = PublicInbox::TLS::epollbit() or return CORE::close($sock);
- $wbuf = [ \&PublicInbox::DS::accept_tls_step, \&greet ];
- }
- $self->SUPER::new($sock, $ev | EPOLLONESHOT);
- if ($wbuf) {
- $self->{wbuf} = $wbuf;
- } else {
- greet($self);
- }
- $self;
+sub new {
+ my (undef, $sock, $imapd) = @_;
+ (bless { imapd => $imapd }, 'PublicInbox::IMAP_preauth')->greet($sock)